标签:
1,承接上一随笔,因为我用的是rmp的两种反式。
rpm -ivh MySQL-server-4.0.14-0.i386.rpm
rpm -ivh MySQL-client-4.0.14-0.i386.rpm
我发现在我的linux下/etc/目录下面没有我my.cnf文件。这听说是我用了这种方式安装mysql的问题
于是:
[root@iZ945sgm0ugZ etc]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
并在my.cnf的[client]下加了一行default-character-set=utf8
[client] #password = your_password default-character-set=utf8 port = 3306 socket = /var/lib/mysql/mysql.sock
且我还在[mysqld]下面加character-set-server=utf8
[mysqld] character-set-server=utf8
重新启动:
[root@iZ945sgm0ugZ etc]# service mysql stop Shutting down MySQL... [ OK ] [root@iZ945sgm0ugZ etc]# service mysql start Starting MySQL.. [ OK ]
乱码问题解决,ok
标签:
原文地址:http://www.cnblogs.com/Eddyer/p/4995056.html