How to import and export databases and data tables using mysql: bitsCN.com
How to import and export databases and data tables in mysql.
In Linux, all operations are performed on the console.
1. import the database:
Prerequisites: the database and data table must exist (already created)
(1) import the data table test_user. SQL to the test_user table of the test database.
[Root @ test ~] # Mysql-uroot-p test </www/web/test/test_user. SQL
(2) import the database test. SQL to the test database test.
[Root @ test ~] # Mysql-uroot-p test </www/web/test. SQL
(3) the source command is not in the console. you need to go to mysql to perform the operation.
Mysql> use test;
Mysql> source/www/web/test. SQL
2. export the database:
(1) export the database test to/www/web/test. SQL
[Root @ test ~] # Mysqldump-uroot-p test>/www/web/test. SQL
Enter the password # www.jbxue.com
(2) export the user data table in database test to/www/web/test/user. SQL
[Root @ test ~] # Mysqldump-uroot-p test user </www/web/test/user. SQL
BitsCN.com