mysql restore (under Windows)

Hi,

If you want to use mysqldump to back up the database, you can enter the full path when typing the command, or add the path c:\wamp\bin\mysql\mysql5.0.51b\bin to the System variable PATH in Control Panel – System – Advanced – Environment Variables – System variables.

You can make a backup from the command line or a scheduled task in Windows like this, assuming that myusername and mypassword have access to the database mydatabase:

mysqldump -umyusername -pmypassword mydatabase > mydatabase.sql

You can restore the database using the mysql command from the command line:

mysql -umyusername -pmypassword -D mydatabase < mydatabase.sql

More info from the command line:
mysql –help | more

Author: Thomas Faddegon

Do you like my posts and want to do something back? You can buy me a beer :)