Games are up

Published March 26, 2006
Advertisement
Finally got with the server monkeys. For some reason, the tables got deleted (just the data, not the form). He was able to refill 'em from a Wednesday backup.

I'm not sure exactly when the database went kaboom, as I just noticed it last night. Anyway, high score tables on and after Wednesday are gone. Sorry.

I probably ought to work up some kind of backup solution, dumping the database to a text file from time to time.

If anyone's familiar enough with SQL to give me an easy solution to these, I'd appreciate. . .

A) Determining if the DB is down so I can tell the user "sorry, come back tomorrow".

2) Saving the data to a text file so that I can resurrect a database that goes down.

III) Coming up with a consistent way of numbering lists in blog entries.
Previous Entry Games are down
0 likes 3 comments

Comments

Will F
Quote:A) Determining if the DB is down so I can tell the user "sorry, come back tomorrow".

2) Saving the data to a text file so that I can resurrect a database that goes down.


I'm not a SQL guru, but i'll venture a couple guesses.

What are you using for software? Your last entry mentioned MySQL (and glancing at the last few entries I didn't see much about the project) - if so mysqldump is one way to backup your database.

For determining if the DB is down, in PHP the function mysql_connect will return false if it is unable to connect. I'm sure other languages have some way of doing this.

EDIT: oops, didn't notice that there were links to the games at the top of your journal - so forget about the PHP advice. Sorry I don't know much about flash
March 26, 2006 05:55 PM
johnhattan
Actually the Flash is all talking to PHP on the server side as the glue between Flash and mySQL.
March 26, 2006 09:24 PM
MauMan
To backup a database:

mysqldump --user={username} --password={password} {DatabaseName} > {DatabaseName}.sql

To delete a corrupted database and recreate it:

mysql --user={username} --password={password} -e "drop database {DatabaseName}"
mysql --user={username} --password={password} -e "create database {DatabaseName}"


To restore back into an empty database

mysql --user={username} --password={password} {DatabaseName} < {DatabaseName}.sql

A good MySQL CheatSheet.
March 27, 2006 08:16 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement