The method for adding fields in MySQL is not complex. The following describes how to add and modify fields in MySQL. It is helpful for you to learn how to add fields in MySQL.
1. log on to the database> mysql-u root-p database name 2. query all data tables> show tables; 3. query table field information> desc table name; 4.1 add table field alter table table1 add transactor varchar (10) not Null; alter table table1 add id int unsigned not Null auto_increment primary key4.2. modify the field type of a table and specify an empty or non-empty www.2cto.com> alter table name change field Name field type [whether or not allow non-null];> alter table name modify Field Name field type [whether to allow non-empty];> alter table name modify Field Name field type [whether to allow non-empty]; 4. 3. modify the field name of a table and specify it as null or not> alter table name change field Original Name field New Name field type [whether to allow non-empty 4.4 if you want to delete a field, command available: alter table mytable DROP field name;
Author summer Spring