Last month when my web server (whic is now host this page ;p) is crash, I was so sad and have to setup the server again :( It take a lot of time to setup this server again, lucky I have backup the MySQL database and able to retrieve back ;)
To Backup the MySQL DB, it just a simple command:
mysqldump --add-drop-table -u user --password=mypassword database> lbesql
–add-drop-table switch will drop the database table before create it again, -u is the username for the MySQL administrator, -p is to tell mysql to prompt you (thanks to aizatto for the correction :D) and of cause –password is the password for the user.
So how to restore back the backup DB? It is easy:
mysql -u user -p -Ddatabase --password=mypassword < lbesql
after you have enter the command, of it will ask you the password, just give it the password and wahla...the DB is restore back :) more detail on how to retrieve back the database can refer to Restoring Back Your Database.