MySQL Import export database, data table method _mysql

Source: Internet
Author: User

Linux under
are operated under the console.
To import a database:
Prerequisite: Database and datasheet to exist (already created)

(1) Import the datasheet test_user.sql into the Test_user table of the test database
[Root@test ~]# mysql-uroot-p Test </www/web/test/test_user.sql

(2) Import database Test.sql into test database test
[Root@test ~]# mysql-uroot-p Test </www/web/test/test.sql

(3) Source command is not under the console, to enter the operation under MySQL
mysql> use test;
Mysql>source/www/web/test/test.sql

To export a database:

(1) Export database test to/www/web/test/test.sql
[root@test ~]# mysqldump-uroot-p Test >/www/web/test/test.sql
Prompt for password when entering a carriage

(2) Export the User data table in the database test to/www/web/test/user.sql
[Root@test ~]# mysqldump-uroot-p test User </www/web/test/user.sql

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.