MySQL operation
(Note: The black body is the system keyword portion, the hemoid is the user variable portion)
Basic operation Login Mysql -u root -p 123456 (execute the command in the bin directory, where root is the username, 123456 for password) Create a database Create Database DatabaseName; select Database Use DatabaseName Delete Database DROP DATABASE DATABASENAME; Create Table Create Table Tablename ID INT NOT NULL AUTO_INCREMENT, STUID INT, Courseid Int, RMTIME TIMESTAMP, PRIMARY Key (ID), Insert Information Insert Into Tablename VALUES (1, 'Admin', 'Admin "; (Number) Directly use numbers to choose information 1, select * from tablename; 2, select itemname from tablename; 3, select itemname1, itemname2 from tablename; 4, selection * from tablename where it is = name (Note If the field is the character, add a single quotation number) 5, select * from tablename where itemname1 = name1 and itemname2 = name2; 6, select t1.name, t2.salary from tablename1 as t1, tablename2 as t2 where t1.name = T2.NAME; 7, SELECT T1.NAME, T2.SALARY from Tablename1 T1, Tablename2 T2 Where T1.NAME = T2.Name; 8, Select ItemName As Name from Tablename; (Output Name) 9, SELECT ITEMN AME from Tablename Having Name; (Selected Condition is whether there is a specified field) 10, select itemname from tablename Having Name> 10; (Selection Condition is specified) 11, SELECT ITEMNAME FROM TABLENAME LIMIT M; M (Maximum record Number 12, Select ItemName from Tablename Limit N, M; (n is the offset of the first row of records to be returned, M is the maximum number of returns record) 13, select * into outfile 'filename.sql' from TableName (Export information from the database) Modify the table structure Delete Table DROP TABLE TABLENAME; Recovery Data 1, Load Data Infile 'filename.sql' INTO TABLETENAME; (From File Import Information to Database Table) 2, mysqladmin - U root -p 123456 create databaseename mysql -u root -p 123456 databasename In addition, please refer to the detailed syntax: mysql syntax manual .htm, More references: http://www.moon-soft.com/program/book/mysql/index.htmlhttp://www.linuxforum.net/books/mysqlmanual/Manual_Toc.html