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