Back up a database using the mysqldump command
Basic Syntax: mysqldump-u username-p dbname table1 table2...> BackupName. SQL back up multiple databases
Syntax: mysqldump-u username-p -- databases dbname1 dbname2> bankupName. SQL back up all databases
Mysqldump-u username-p -- all-databases> BackupName. SQL directly copies the entire database directory. Using mysqlhotcopy to quickly back up mysqlhotcopy is a Perl script, mainly used in Linux operating systems. The mysqlhotcopy tool is not provided by MySQL. You need to install the Perl data interface package. Restore data using mysql commands
Mysql-u-root-p [dbname] <backup. SQL is directly copied to the database directory.
Make sure that the version numbers of the two MySQL databases are the same.
This method is also used to restore the database backed up by the mysqlhotcopy command. For data migration between databases of the same MySQL version, data migration tables are of the MyISAM type. You can directly copy the database directory to migrate the database. Use the mysqlhotcopy command to back up the database, and then use the mysql command to restore the backup file to the new MySQL database. Export and import the SELECT [column name] from table [WHERE statement] of the OP TABLE
Into outfile 'destination file' [OPTION]; Use the mysqldump command to export a text file
Mysqldump-u root-pPassword-T target directory dbname table [option]; use mysql command to export text files
Mysql-u root-pPassword-e "SELLECT statement" dbname> D:/name.txt;