(1)通过mysql
(2)修改默认字符集
>在etc文件夹下新建my.cnf文件
>将usr/share/mysql/my-large.cnf文件里面的内容拷贝到my.cnf
>然后修改my.cnf文件,修改如下:
[mysqld]
character-set-server=utf8
init_connect='SET
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
#
symbolic-links=0
#
#
#
#
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
default-character-set=utf8
(3)新建数据库
GBK: create database test2 DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci;
UTF8: CREATE DATABASE `test2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
(4)命令导入.sql文件
Mysql
(5)创建用户
grant
grant