In fact, I always think that databases are more difficult to understand than Ningbo's sister paper, but both of them have to face it ~
The story will continue, and the post will be updated occasionally ~
Connect to MySQL on the remote host: mysql-h110.110.110.110-uroot-pabcd123
Exit MySQL command: Exit/quit
Display the Database List: Show databases;
Database: Use Database Name;
Show tables;
Display the data table structure: DESC/describe table name;
Create Database: create databases database name;
Table creation: Create Table table name;
Clear a table: delete from table name; or truncate table name; Delete is a bit like deleting all records in the MySQL table one by one, while truncate is equivalent to retaining the structure of the MySQL table, after this table is re-created, all statuses are equivalent to new tables.
Database deletion and table deletion: drop database database name; drop table name;
Export Database: mysqldump-uroot-p123 database_test> database_test. SQL
Export table: mysqldump-uroot-pt123 database_test table_test> table_test. SQL
Export the select result to the file: mysql-h127.0.0.1-uroot-p0000-e "select * From table_name" database_name> 1.txt
Displays the records in the Table: Select * from table name;
Row count: Select count (*) from table name;
Show warnings;
Show errors;
Insert: insert into teacher values ('', 'glengang ', 'xx company', '2017-10-10 ');
Update: Update adregex_sample_0424 set is_wrong = 'true' where adnetwork_domain = 'travel .yahoo.com ';
Use utf8 Character Set: Set names utf8