Rumah >pangkalan data >tutorial mysql >mysqlcreatedatabase指定utf-8编码_MySQL
如下脚本创建数据库yourdbname,并制定默认的字符集是utf8CREATE DATABASE IF NOT EXISTS yourdbname DEFAULT CHARSET utf8 COLLATE utf8_general_ci;如果要创建默认gbk字符集的数据库可以用下面的sql:create database yourdb DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci;