Linux data export and import sql

Linux under the command mysql sql file import and export

 

Export Database

Direct use the command:

mysqldump -u root -p library name> 123.sql

And then enter a password on it;

mysqldump -u username -p database link target database> stored file name

File is exported to the current directory

Importing database (sql file)

mysql -u username -p database name <database name .sql
mysql -u -p abc the Test <test.sql

Note sql file must be in the current directory, if not in the current directory needs in <sql file after adding a specific path

Export Database

Direct use the command:

mysqldump -u root -p library name> 123.sql

And then enter a password on it;

mysqldump -u username -p database link target database> stored file name

File is exported to the current directory

Importing database (sql file)

mysql -u username -p database name <database name .sql
mysql -u -p abc the Test <test.sql

Note sql file must be in the current directory, if not in the current directory needs in <sql file after adding a specific path

Guess you like

Origin www.cnblogs.com/herocan/p/11257236.html