One, MySQL 's software architecture
A) turn on MySQL server: Open in the form of Windows service, under cmd net start mysql|net Stop MySQL, use mysqld –default-file= "D:/amp/mysql/my.ini" under cmd
b) connect to MySQL server
c) MySQL command, help, the instructions can all use the \ Letter to complete
d) MySQL comment: line comment:# or -- , block comment is / * * /
Second, the operation of the database
A) creating database:Create library name [ library option ];
b) View database:show databases; Show CREATE DATABASE name ;
c) Delete database: Drop databases[if exists] library name
d) Modify the database: Only library options can be modified;Alter library name new library options
Third, data table Operation
A) Select the database: Explicit selection, with the name of the name in front of the table, the implicit choice,use the name of the library ;
b) Create a data table:The CREATE table table name (field list)[ table Options ];
c) View data sheet:show tables; Show CREATE table table name ; describe|desc table name ;
d) Modify the data sheet:
- Modify table name: alter tables table name rename to new table name; rename table old table name to new table name
- modify column definition:
- add a column: ALTER TABLE Span style= "font-family: Arial" > table name add new field type name;
- Delete a column: ALTER TABLE table name drop field name;
- modify field type: ALTER TABLE modify Field name new field type
- modify field sort: ALTER TABLE modify field name 1 new field type
First|after field name 2
- Rename field:ALTER TABLE name change old field name new field name new field type
- Modify Table options:ALTER TABLE table name new tables option (default charset GBK engine Myisam)
Four, data manipulation
A) Insert data:INSERT into table name (field list) values(Value list)
b) View data:Select *| Field List from Table name [where query condition ]
c) Delete data:delete from table name [where delete condition ]
d) Modify data:update table name set field 1= New value 1, field 2 = New Value 2 ... [where Modify condition ]
MySQL Data manipulation