MySQL backup and restoration are completed using mysqldump, mysql, and source commands. 1. MySQL backup and restoration 1.1 backup Start Menu under Win32 | run | cmd | use the "cdProgramFilesMySQLMySQLServer5.0bin" command to enter the bin folder | use the "mysqldump-u username-pdatabasenameexp
MySQL backup and restoration are completed using mysqldump, mysql, and source commands. 1. mySQL backup and restoration 1.1 backup Start Menu under Win32 | run | cmd | use the "cd/Program Files/MySQL Server 5.0/bin" command to enter the bin folder | use "mysqldump- u username-p databasename exp
MySQL backup and restoration are completed using mysqldump, mysql, and source commands.
1. MySQL backup and restoration under Win32
1.1 backup
Start Menu | run | cmd | use the "cd/Program Files/MySQL Server 5.0/bin" command to enter the bin folder | use "mysqldump-u username-p databasename> exportfilename" to export database to file, for example, mysqldump-u root-p voice> voice. SQL, and then enter the password to start exporting.
1.2 restore
Enter the MySQL Command Line Client, enter the password, go to "mysql>", enter the Command "show databases;", Press enter to see what databases are there, and create the database you want to restore, enter "create database voice;", Press ENTER; switch to the database you just created, enter "use voice;", Press ENTER; import data, and enter "source voice. SQL; ", Press enter to start importing, and" mysql> "is displayed again. If no error is returned, the restoration is successful.
2. MySQL backup and restoration in Linux
2.1 backup
[Root @ localhost ~] # Cd/var/lib/mysql (go to the MySQL database directory and adjust the directory based on your MySQL installation)
[Root @ localhost mysql] # mysqldump-u root-p voice> voice. SQL. Enter the password.
2.2 restore
Method 1:
[Root @ localhost ~] # Mysql-u root-p press enter and enter the password to go To the MySQL console "mysql>", which is restored in the same way as 1.2.
Method 2:
[Root @ localhost ~] # Cd/var/lib/mysql (go to the MySQL database directory and adjust the directory based on your MySQL installation)
[Root @ localhost mysql] # mysql-u root-p voice