1) show databases;
2) use dB; enter the database
3) select database (); -- displays the current database
4) Select "consstr" as colname, T. * From tablename T;
5) Select. ID,. valuea, Case (B. valueb is null) when 1 then 'Z' else B. valueb end from tablea as a left join tableb as B on (ID );
6) import the. SQL script:
In the command line: mysql-H ***-u ***-P <***. SQL
Go to MySQL and go to MySQL> command line: Source **. SQL
7) in MySQL, you can arrange query results in vertical lines. You only need to use \ G instead of the semicolon at the end of the query statement. For example:
Select * from test limit 10 \ G
8) show tables like '% name % ';
9) view the table creation statement: Show create table tablename;
10) delete a primary key: alter table tablename drop primary key;
11) export data:
Select * from table into OUTFILE 'filename'; -- can only be exported on the local machine.
Mysqldump-H host-u user-ppwd database table> File
12) import data:
Load data infile 'filepath' into Table tablename;
Mysqldump...