MySQL table structure Import and export MySQL table structure Import and Export

Source: Internet
Author: User
Tags mysql command line mysql import

MySQL table structure Import and Export

MySQL table structure Import and export:

Linux under the path can be changed, such as the database Gaomart table structure export:
Windows mysqldump-d-uroot-p123456 gaomart>d:/gaomart.sql
Linux in mysqldump-d-uroot-p123456 gaomart>/home/liangjian/gaomart.sql

If you do not add-D, all data and table structures are imported. Add-D to export only the table structure.

1. Enter cmd into DOS command window in operation

2. Enter the bin directory under the MySQL installation directory

3. Input Mysqldump-u root-p-D database > D:/gaomart.sql

4, then enter the password return.

Import:

Data and table structure for MySQL import under Windows system:

1. mysql Command line Client into MySQL

2, enter the password after the return

3. Enter use database and return

4, enter the source D:\gaomart.sql and then return

Linux under different paths for example: Enter Source/home/liangjian/gaomart.sql and then return

----------------------

1.MySQL Command Import

Mysql-h server Address-P Port-u user name-p database name < file name. sql

Sometimes error at line:unknown command ' \ ' occurs because of a problem with the database character set. At this time, as long as the order and--default-character-set=utf8 can be solved.

Note: "-P port" This parameter, if the server uses the default port 3306, it can be ignored!
Is it related to the problem above?


This article is from the "Dream to Reality" blog, please be sure to keep this source http://lookingdream.blog.51cto.com/5177800/1853986

MySQL table structure Import and export MySQL table structure Import and Export

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.