Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql commands for importing and exporting databases and adding and modifying fields

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "Mysql import and export database and add and modify fields related commands", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Mysql import and export database and add and modify fields related commands" bar!

The Mysql export table contains data commands:

Dump-uroot-proot abc > / var/abc.sql

(mysql username: root password root database: abc export to: / var/abc.sql)

The Mysql export database table does not contain data commands:

Mysqldump-uroot-proot-d abc > / var/abc.sql

Mysql imports tables and data:

Use abc

Source / var/abc.sql

(to select an abc database, the file to be imported is: / var/abc.sql)

Mysql add Field:

Alter table table1 add name varchar (10) not Null

/ / add a name field to the table1 table with the field type varchar (10)

Alter table table1 add sid int not Null auto_increment primary key

/ / w add a self-increment to the table1 table gradually

Mysql modify command:

Alter table table1 change name name1 varchar (20) not Null

/ / modify the table table1 to modify the name field in table1 to name1, and change the type to varchar (20) is not empty

At this point, I believe that everyone on the "Mysql import and export database and add modified fields related commands" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report