Archive for the ‘MySQL Widgets’ Category

Copy/Backup MySQL Database

March 25th, 2010

 

To backup or copy the content of mysql database you can use shell command ‘mysqldump’.
Syntax goes something like this:

mysqldump database_name > some_file.sql -p (if you will use database root user)

or:

mysqldump -u user database_name > some_file.sql -p (if you will use some specific database user)

You will be promped to enter root password after this.

 

 

To restore database from a file you can use something like this:

mysql database_name < some_file.sql -p

or:

mysql -u user database_name < some_file.sql -p