Export all data in the database. 1. input mysqldump-uuserName-pdabaseNamefileNamesqlfileNamesql in the linux command line to export the data of a table in the database with the path name mysqldump-uuserName.
Export all data in the entire database
1. enter the following in the linux command line:
mysqldump -u userName -p dabaseName > fileName.sql
FileName. it is best to add the path name to SQL.
Export the data of a table in the database
mysqldump -u userName -p dabaseName tableName > fileName.sql
Export all table structures in the entire database
In the linux command line, enter:
mysqldump -u userName -p -d dabaseName > fileName.sql
Note:-d is added.
Export the table structure of a table in the entire database
In the linux command line, enter:
mysqldump -u userName -p -d dabaseName tableName > fileName.sql
Note:-d is added.
Import mysql method 1
Go to the linux command line:
Mysql-uroot-p Press enter and enter the password source fileName. SQL. Note that fileName. SQL requires a path name, for example, source/home/user/data/fileName. SQL.
Method 2 for importing mysql
Go to the linux command line:
Mysql-uroot-p database <fileName. SQL note that fileName. SQL must have a path name