MySQL Import and Export databases, add and modify field commands

Source: Internet
Author: User
Tags mysql export database mysql import

 

MySQL export database table contains data commands:

Mysqldump-uroot-proot ABC>/var/ABC. SQL;
(MySQL user name: Root Password root database: ABC export to:/var/ABC. SQL)

MySQL export database tables do not contain data commands:

Mysqldump-uroot-proot-d abc>/var/ABC. SQL;

MySQL import tables and data:

Use ABC; Source/var/ABC. SQL;

(Select the ABC database. The file to be imported is/var/ABC. SQL)

Add a MySQL field:

Alter table Table1 Add name varchar (10) Not NULL; // Add a Name field for table 1. The field type is varchar (10) alter table Table1 add Sid int not null auto_increment primary key // W add an auto increment gradually for table 1

MySQL modification command:

Alter table Table1 change name name1 varchar (20) not null; // Modify Table 1 to change the name field in table 1 to name1, and change the type to varchar (20) not empty.

Learning lies in accumulation!

@ Author: spring sky

Email: vipa1888@163.com

QQ: 840950105

Related Article

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.