mysql
DDL
create
create a database in mysql console
> CREATE DATABASE my_db CHARACTER SET utf8;
alter
- change the character set of database
> ALTER DATABASE my_db CHARACTER SET utf8;
- change the character set of table
> ALTER TABLE my_table DEFAULT CHARACTER SET utf8;
show
- list databases
> show databases;
- show the create information of table
> SHOW CREATE TABLE my_table;
- show the info of database
> \s
- show the character info of database
> show variables like 'character_set_%'
drop
- drop database
> DROP DATABASE my_db
- drop table
> DROP TABLE my_table
DML
delete
> DELETE FROM my_table [WHERE ]
issues
- Mysql 错误1366, “Incorrect string value: ‘\xE6\xB7\xB1\xE5\x85\xA5…’ for column ’
设定UTF8 字符集