How to Backup & Restore XML in Mysql
- 1). Log on to the computer where the MySQL database resides.
- 2). List the MySQL databases on the computer by running the following command:
mysql show databases - 3). Back up the database by running the following command:
mysqldump --opt -u [username] -p[password] [database_name] > [backup_filename.sql], where [username] is your database username, [password] is the password for your database, [database_name] is the name of your database, and [backup_filename.sql] is the filename for your database backup. - 1). Log on to the computer where you want to restore the MySQL database.
- 2). Create a database by issuing the following command:
mysql -u [username] -p[password] -- execute "CREATE DATABASE [database_name]; GRANT ALL ON [database_name].* TO [admin]", where [username] is your database username, [password] is the password for your database, [database_name] is the name of your database, and [admin] is the user ID you want to grant access to the database. - 3). Load the database backup file into the newly created database by running the following command:
mysql -u [username] -p[password] [database_name] < [backup_filename.sql]
where [backup_filename.sql] is the filename for your database backup.
Performing a Backup of a MySQL Database Using Mysqldump
Restoring a MySQL Database
Source...