MySQL basic command: 1, net stop MySQL//shut down MySQL client
2. net start MySQL//turn on MySQL
3, Mysql-u root-p123 (password)//login MySQL Client
4, show databases;//View Database
5. Use test;//switch to test database
6, show tables;//View all tables
7. Select *from User;//view table data
8. DESC User//View table field
9, drop database user;//delete databases
10, Exit//Exit Client
11. Rename table user to User1//modify the tables name
12. drop TABLE user;//Delete tables
13. Show create DATABASE test;//view DB Character Set
14. Show CREATE table user;//view the tables character set
15. Insert into User (Id,name,pass) VALUES (1, "xiaoming", 123);//Add Data
16. Select *from user;//View data
· 17. Delete from user where id=1;//deletes data under a condition
18. Update user Set name = "Floret" where id=1;//change content
19. ALTER TABLE user add age int;//add field
20. ALTER TABLE user modify age int NOT null default 20;//modify field
21. ALTER TABLE user drop age;//Delete field
22. ALTER TABLE user change name username varchar (30);//Modify field name
MySQL basic commands