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 Fields
Alter table Table1 add transactor varchar (10) Not NULL;
Alter table Table1 add ID int unsigned not null auto_increment primary key
. Modify the field type of a table and specify it as null or not
> Alter table table name change field Name field type [whether to allow non-null];
> Alter table table name Modify Field Name field type [whether to allow non-null];
> Alter table table name Modify Field Name field type [whether to allow non-null];
. Modify the field name of a table and specify it as null or not
> Alter table table name change field Original Name field New Name field type [whether to allow non-null
4.4 If you want to delete a field, run alter table mytable drop field name;