MySQL backup and recovery

xiaoxiao2021-03-06  43

Direct copy database file

Find my mysql installation directory, if it is a UNIX series host, enter the data directory, TAR CVF [Database Name] .Tar [Database Name], then move to the user directory, use ftp download this file, then copy it to this machine MySQL corresponding to the corresponding directory can.

2. Using mysqldump

Export: mysqldump --opt -u root -p [password]> dbbak.sql (using --opt without using Quick, because Quick comes out, no DROP, and do not lock the table. And the OPT is quite Located in --quick --add-drop-table --add-locks --extended-insert --lock-tables. It can guarantee data integrity and DROP when importing, is also convenient.)

Import: mysql -u root -p [password]

转载请注明原文地址:https://www.9cbs.com/read-52334.html

New Post(0)