1. In the command line, type NET Start/stop mysql on/off MySQL service
2. Type the Mysql-u user name-p password in the command line to connect to the database
(The following command must be followed by a semicolon '; ') )
3. Use the show statement to show what database exists on the current server: show databases;
4. Create a database with the creation statement: The name of the Create library;
5. Use the USE statement to select the database to be used: Using Test;
6. Use the show statement to see which tables are available: show tables;
7. Create a database table
CREATE TABLE Person
(
Name varchar () is not NULL,
Password varchar () NOT NULL
);
8. Display the structure of the table: Describe table name
9. Add a record to the table: INSERT into table name values (' Value ',..., ' value ');
10. Update the data in the table: Update table name set column Header = ' value ';
11. Import the local file with load: Load data local infile ' file name ' into table table name;
The column and column values in the local file are separated by the "tab" key, and the rows and rows are separated by a carriage return character
12. Select data:
1) Select all data: SELECT * FROM table name
2) Select specific data: SELECT * FROM table name WHERE range (logical connection Word is and,or, etc.)
13. Add Column: Alter table tabname add column col type
The following example statement adds a PSD field to the table user.
mysql> ALTER TABLE user ADD COLUMN psd INT (10);
14. Delete Column: ALTER TABLE tablename drop ColumnName
The following example statement removes the PSD field from the table user.
mysql> ALTER TABLE user drop PSD;
15. Delete records:
DELETE from TableName [WHERE CONDITIONAL];
No where means delete all records in table
Procedure statements, see http://www.blogjava.net/kissjava/archive/2008/07/16/215177.html,
MySQL Common command Summary