Article From:https://www.cnblogs.com/victorcode/p/9970917.html

Export the whole database structure and data

mysqldump -h 127.0.0.1 -uroot -p database > /usr/local/dump.sql

Export single data table structure and data
mysqldump -h 127.0.0.1 -uroot -p123456 database table > dump.sql

Export the entire database structure (excluding data)
mysqldump -h 127.0.0.1 -uroot -p123456 -d database > dump.sql

Export a single data table structure (excluding data)
mysqldump -h 127.0.0.1 -uroot -p123456 -d database table > dump.sql

 

Import MySQL method
Enter the Linux command line:
mysql -uroot -p 123456
show databases;
source fileName.sql
Note that fileName. SQL has a path name, such as source / home / user / data / fileName. SQL

Leave a Reply

Your email address will not be published. Required fields are marked *