linux下更改MySQL数据库编码格式为utf-8


设置MySQL数据库编码为UTF-8

 登陆后查看数据库当前编码:SHOW VARIABLES LIKE 'char%';
 修改/etc/mysql/my.cnf (默认安装路径下) (标签下没有的添加,有的修改)

  [mysqld]

     character_set_server=utf8

     [mysql]

     default-character-set= utf8

     [client]

     default-character-set = utf8

重启MySQL服务

service mysql stop;

service mysql start;


查看数据库编码:SHOW VARIABLES LIKE 'char%';
posted @ 2017-09-13 15:45  过道  阅读(2883)  评论(0编辑  收藏  举报