MySQL Common Export Data command:
1.mysql exporting the entire database
mysqldump-u[user Name]-p [Database name]> [file name].sql
To illustrate:
Mysqldump-uroot-p salemanage> D:salemanage.sql
2.mysql Export Database A table
mysqldump-u[user Name]-p [database name] [table name]> [filename]].sql
Mysqldump-uroot-p salemanage t_user> D:user.sql
3.mysql Exporting a database structure
mysqldump-u[user Name]-p-d--add-drop-table [database name]>[file name].sql
-D No data--add-drop-table add a drop table before each CREATE statement
Mysqldump-uroot-p-D--add-drop-table salemanage > D:salemanageconstruct.sql
4. If you need to export a function or stored procedure inside MySQL
mysqldump-u[database name]-p-ntd-r [database name] > [File name].sql
Mysqldump-uroot-p-ntd-r salemanage > Salemanagefunction.sql
Where the-NTD is the export stored procedure;-R is a representation of the export function
MySQL common command to import data: During the import process, you should create a database and import it, or you will get an error.
1.mysql command
mysql-u[user Name]-p [Database name] < [filename].sql
Mysql-uroot-p Salemanage < Salemanage.sql
2.source command
Mysql>source Salemanage.sql; If you first select a database and then import it
Import and export commands for MySQL database