Mysql import and export databases, add the modify field command _ MySQL

Source: Internet
Author: User
Tags mysql export database mysql import
Mysql imports and exports databases and adds the modify field command bitsCN.com

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 adds an auto-incrementing 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 the type to varchar (20 ).

Learning lies in accumulation!

@ Author: spring sky

Email: vipa1888@163.com

QQ: 840950105

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.