MySQL version: 5.7.13
1. Run the command prompt as an administrator and go to the installation location of MySQL
2. Start MySQL service: net start MySQL
3.root Identity Login: Mysql-uroot-p Enter
4. List all databases: show databases;
5. Creation of a database: Create databases database_name;
6. Determine if there is a re-creation database: Create databases if not EXISTS database_name;
7. Delete databases: DROP database database_name;
8. Select a database: Use database_name;
9. List all data tables in the selected database: Show tables;
10. Columns of the Display data table (column) Details: Show columns fromtable_name; or: Describetable_name;
11. Check the Display data sheet: SELECT * FROMtable_name;
12. Conditional Presentation Data sheet: SELECT * FROM table_name whereID>=2;
13. Creating a data table: CREATE TABLEtable_name(Col_01_nameType Details, col_02_name Type Details,...);
14. First determine the data table: CREATE table if not existstable_name(...);
15. Copy Data sheet: CREATE tabletable_name_01SELECT * FROMtable_name_02;
16. Renaming the data table: ALTER TABLEtable_nameRename asnew_table_name; Or: Rename tableOld_nameTonew_name;
17. Delete Data sheet: drop tabletable_name;
18. Add a record to the data table: INSERT INTO table_name set col_01 = value1 , col_02 = value2 ;
19. Modify the records in the datasheet: Update table_name set col_name = new_value where ID = 1;
20. Delete the records in the data table: Delete from table_name ;
21. Record in a conditionally deleted data table: Delete from table_name where id =1;
#当前时间查看: Select Now ();
#当前用户: Select User ();
#当前数据库程序版本: Select version ();
#当前状态: Show status;
#查看当前连接的用户: Show Processlist;
MySQL Simple operation