RATE THIS ANSWER
+1
Click to Vote:
1
0
From a command prompt, you can backup your entire database using this line:
mysqldump -u user_name -p your_password database_name > File_name.sql
Example:
Let's assume that:
Username: bobbyjoe
Password: happy234
Database Name: BobsData
mysqldump -u bobbyjoe -p happy234 BobsData > BobBackup.sql
This will backup the database to a file called BobBackup.sql
To restore the database CANNOT already exist:
This will only work if the database does not already exist:
mysql - u user_name -p your_password database_name < file_name.sql
Or using our example from the previous page:
mysql - u bobbyjoe -p happy234 BobsData < BobBackup.sql
If your database already exists and you are just restoring it, try this line instead:
mysqlimport -u user_name -p your_password database_name file_name.sql
Or using our example again:
mysqlimport -u bobbyjoe -p happy234 BobsData BobBackup.sql
Last Answered:
Jan 23 2009 2:15 PM GMT by KarlG 
7305 pts.