Jump to content
  • entries
    1212
  • comments
    1738
  • views
    1144999

Games are up

Sign in to follow this  
johnhattan

173 views

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.
Sign in to follow this  


3 Comments


Recommended Comments

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

Share this comment


Link to comment
Actually the Flash is all talking to PHP on the server side as the glue between Flash and mySQL.

Share this comment


Link to comment
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.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!