Basic command: (SQL semicolon end, remember, remember)
Login mysql:mysql-h ip-u User name-p or mysql-u user name-p password
View database: show databases;//Many databases, so databases
(where Information_schema/mysql/perfornance_schema data cannot be modified, the system comes with it)
Select a database: Use library name;
View table: Show tables;//Many tables, so tables
Delete Library: drop database name;
Creating Table: Create TABLE Class (Stu int, name varchar (), age int., area varchar (20));
Delete tables: drop table name; (Note: The table name can be changed, but the library name cannot be changed)
Renaming tables: Rename table Oldname to newname;
View table structure: DESC table name;
Statement input error, enter "\c", you can end the execution of the statement;
(4 basic operation of the table) increase, delete, check, change:
Insert: (Increase)
Insert into table name (ID, title, name, content) VALUES (1, ' hello ', ' ggg ', ' kkhely '), (2, ' hhoooo ', ' ffff ', ' Ggge ');
Update: (change)
Update indicates set id=2, content = ' GGLKJJK ' WHERE name = ' GGG '; (Conditions are set later)
Find: (check)
SELECT * from table name;
Select ID, title from table name where id>2;
Delete: (deleted)
Delete from table name where name= ' GGG ';(set novice mode, i.e. no where will not run the statement)
Note the point:
To resolve character Set issues:
The default build table is generally used UTF8, while Windows CMD is the GBK character set, so you need to declare the character set;
As follows:
Set name GBK;
Subject:
C + + uses hash table to implement English word lookup system
Getting Started with MySQL basics