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 字符集
本文介绍了MySQL中数据库定义语言(DDL)和数据操纵语言(DML)的基本操作,包括创建、修改和删除数据库及表,展示了如何使用SQL命令来实现这些功能,并提供了具体的例子。
487

被折叠的 条评论
为什么被折叠?



