MySQL Common Export Data command:
1.mysql Export the entire database
Mysqldump-hhostname-uusername-ppassword databasename > Backupfile.sql
Mysqldump-hlocalhost-uroot hqgr> Hqgr.sql (if the root user does not have a password to write-p, of course the exported SQL file you can make a path, unspecified then stored in the MySQL bin directory)
2.mysql Export Database A table
Mysqldump-hhostname-uusername-ppassword database tablename> exported file name
Mysqldump-hlocalhost-uroot hqgr t_ug_user> User.sql
3.mysql Export a database structure
mysqldump-hhostname-uusername-ppassword-d--add-drop-table Databasename>d:hqgrstructure.sql
-D No data--add-drop-table add a drop table before each CREATE statement
4. If you need to export a function or stored procedure inside MySQL
MYSQLDUMP-HHOSTNAME-UUSERNAME-PPASSWORD-NTD -R databasename > Backupflie.sql
mysqldump-hlocalhost-uroot-ntd-r hqgr > Hqgr.sql
-NTD is Represents an export stored procedure;-R is a command that represents the exported function
mysql common import data:
1.mysql command
Mysql-hhostname- Uusername-ppassword DatabaseName < Backupfile.sql
2.source command
MySQL >source Backupfile.sql