Mysql 5.6 from unfamiliar to skilled _ Database Backup recovery implementation method, mysql5.6
MySQL database uses command line backup | MySQL Database Backup command
For example:
Database address: 127.0.0.1
Database username: root
Database Password: root
Database Name: szldb
Back up the database to disk D and Directory
Mysqldump-h127.0.0.1-uroot-proot szldb> d:/backupfile. SQL
Back up to the current directory to back up the MySQL database in the format of a table with deletion, so that the backup can overwrite the existing database without the need to manually delete the original database
Mysqldump -- add-drop-table-h127.0.0.1-uroot-proot szldb> backupfile. SQL
Directly compress and back up the MySQL database to the D disk and directory.
Mysqldump-h127.0.0.1-uroot-proot szldb | gzip> d:/backupfile. SQL .gz
Back up a table in the MySQL database. In this example, table 1 and table 2 are backed up. Back up data to/home on a linux host
Mysqldump-h127.0.0.1-uroot-proot szldb table1 table2>/home/backupfile. SQL
Back up multiple MySQL databases at the same time
Mysqldump-h127.0.0.1-uroot-proot -- databases szldb test> multibackupfile. SQL
Only back up the database structure. Back up the database named myweb and myweb2 at the same time.
Mysqldump -- no-data-h127.0.0.1-uroot-proot -- databases szldb test> structurebackupfile. SQL
Back up all databases on the server
Mysqldump -- all-databases-h127.0.0.1-uroot-proot> allbackupfile. SQL
Command to restore the MySQL database. Restore the database whose name is backupfile. SQL.
Mysql-h127.0.0.1-uroot-proot szldb <backupfile. SQL
Restore a compressed MySQL database
Gunzip <backupfile. SQL .gz | mysql-h127.0.0.1-uroot-proot szldb
Migrate the database to the new server. In this example, copy the local database myweb to the remote database named serweb. The remote database must be a database named serweb.
Mysqldump-h127.0.0.1-uroot-proot szldb | mysql -- host = ***. ***-u database username-p Database Password-C serweb
The above is all about the implementation methods for mysql 5.6 from unfamiliar to skilled _ Database Backup recovery. I hope you can provide more support ~