Home > Database > Mysql Tutorial > body text

linux mint 下mysql中文支持问题_MySQL

WBOY
Release: 2016-05-30 17:10:55
Original
1350 people have browsed it

一.mysql默认不支持中文,它的server和db默认是latin1编码.所以我们要将其改变为utf-8编码,因为utf-8包含了地球上大部分语言的二进制编码

 

1.关闭mysql服务

 

sudo /etc/init.d/mysql stop

 

2.修改mysql配置文件

 

mysql配置文件默认放在/etc/my.cnf或者/etc/mysql/my.cnf目录下,进入命令行

 

sudo gedit /etc/mysql/my.cnf

在[client]下添加default-character-set = utf8

在[mysqld]下添加character-set-server = utf8

 

3.重启mysql就ok啦

 

sudo /etc/init.d/mysql start

ps:在init.d启动管理中操作mysql的一些命令:

 

/etc/init.d/mysql start|stop|restart|reload|force-reload|status

重要的一点:一定要按照上述方法一步一步执行,最重要的是要先关闭服务再修改文件,切记!!!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!