Mysql import and export database and data table bitsCN.com
Linux
All operations in the console.
Import 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
Export database:
(1) export the database test to/www/web/test. SQL
[Root @ test ~] # Mysqldump-uroot-p test>/www/web/test. SQL
Enter the password
(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