Backup and restore of MySQL under 2.Linux
2.1 Backup
[[email protected] ~]# cd/var/lib/mysql (go to MySQL library directory, adjust the directory according to your MySQL installation situation)
[[email protected] mysql]# mysqldump-u root-p voice>voice.sql, enter the password.
2.2 Restore
Law One:
[[email protected] ~]# mysql-u root-p return, enter the password, enter the MySQL console "mysql>", with 1.2 restore.
1.2 Restore
Enter MySQL command line Client, enter the password, enter the "mysql>", enter the command "show databases;", enter to see what database; Create the database you want to restore, enter the Voice; ", enter; switch to the newly created database, enter" use voice; ", carriage return, import data, enter" source voice.sql; ", carriage return, start import," mysql> "and no prompt error, restore succeeded
Law II:
[[email protected] ~]# cd/var/lib/mysql (go to MySQL library directory, adjust the directory according to your MySQL installation situation)
[[email protected] mysql]# mysql-u root-p voice<voice.sql, enter the password.
Backup and restore of MySQL database