In the reconstruction of the site, the data structure is usually modified, so add, delete, add the MySQL table field is unavoidable, and sometimes for convenience, but also increase the modification of the table or field comments, the same field
I. Commonly Used MySQL command line commands1. Start the MySQL service. Net start MySQL
Stop MySQL service. net stop MySQL
2. netstat-Na | findstr 3306: Check the listening port. findstr is used to check whether the following port exists.
3. log on
In the reconstruction of the site, the data structure is usually modified, so add, delete, add the MySQL table field is unavoidable, and sometimes for convenience, but also increase the modification of the table or field comments, the same field
Mysql changes the table structure: add, delete, modify, and adjust the field order to add a field: altertable 'user _ movement_log 'AddcolumnGatewayIdintnotnulldefault0AFTER 'regionid' (after which field is added) Delete the field: altertable 'user _
1. Display the list of databasesshow databases; # View all current databasesShow Databases \g #以行的方式显示2. On the command line, execute the SQL statementMysql-e ' show databases '-uroot-p123456mysqlshow-uroot-p123456 # not used, just remember the one
How should MySQL add fields be implemented? This is a lot of new contacts MySQL database has been mentioned, the following is to introduce you to MySQL add fields and delete the field method, I hope you can be enlightened.MySQL add field:
Mysql changes the table structure: add, delete, modify, and adjust the field order to add a field: altertable 'user _ movement_log 'AddcolumnGatewayIdintnotnulldefault0AFTER 'regionid' (after which field is added) Delete the field: altertable 'user _
1. Add a field ALTER TABLE user add COLUMN new1 VARCHAR (x) DEFAULT NULL; Add a field that defaults to null ALTER TABLE user add COLUMN new2 VARCHAR (a) not NULL; Add a field, default cannot be empty//2. Delete a field ALTER TABLE
MySQL常用指令,java,php程序员,数据库工程师必备。程序员小冰常用资料整理MySQL common commands (for reference)The most common display commands are:1. Display the list of databases.show databases;2. Display the data table in the library:Use MySQL;Show tables;3, display the
MySQL add field:
ALTER TABLE ' User_movement_log '
add column Gatewayid int not null default 0 after ' RegionID ' (added after which field)
To delete a field:
ALTER TABLE ' user_movement_log ' drop column Gatewayid
To
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.