《Mysql应用Ubuntu15下mysql5.6.25不支持中文的解决办法》要点:
本文介绍了Mysql应用Ubuntu15下mysql5.6.25不支持中文的解决办法,希望对您有用。如果有疑问,可以联系我们。
MYSQL入门apt-get install 安装的,不是源码包安装的mysql
MYSQL入门1 修改mysql的配置文件
MYSQL入门/etc/mysql/conf.d/mysql.cnf
MYSQL入门在[mysql]的下方加入如下语句:(注:这个文件下没有配置,只有【mysql】)
MYSQL入门no-auto-rehash
default-character-set=utf8
MYSQL入门/etc/mysql/mysql.conf.d/mysqld.cnf
MYSQL入门在[mysqld]下加入
MYSQL入门socket = /var/run/mysqld/mysqld.sock
port = 3306
character-set-server=utf8 (这里是server,之前有的版本是set)
MYSQL入门重启mysql: sudo /etc/init.d/mysql restart
MYSQL入门查看字符集
MYSQL入门mysql> show variables like '%char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
MYSQL入门 设置之后如果之前的数据库已经创建了,只能删除重新创建了.
转载请注明本页网址:
http://www.vephp.com/jiaocheng/3672.html