红联Linux门户
Linux帮助

mysql创建utf-8字符集数据库

发布时间:2015-09-24 10:15:58来源:linux网站作者:permike

CREATE DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATEutf8_general_ci;


CREATE DATABASE 的语法:

CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[create_specification [, create_specification] ...]

create_specification:
[DEFAULT] CHARACTER SET charset_name
| [DEFAULT] COLLATE collation_name


更改数据库的字符编码

ALTER DATABASEdb_nameDEFAULTCHARACTERSETutf8COLLATEutf8_general_ci


也谈UTF-8编码:http://www.linuxdiyf.com/linux/3793.html

ubuntu中mysql修改编码utf8:http://www.linuxdiyf.com/linux/13279.html

MySQL字符集GBK转换到UTF8:http://www.linuxdiyf.com/linux/11500.html

MySQL设置数据库的默认编码:http://www.linuxdiyf.com/linux/11889.html