Mysql import and export database and data table _ MySQL

Source: Internet
Author: User
Tags import database mysql import
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

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.