一、安装mysql
1、apt安装:sudo apt-get install mysql-server
2、下载源码安装:http://dev.mysql.com/downloads/mysql/5.6.html#downloads
3、解决中文乱码:修改my.cnf,加入
[client]
default-character-set = utf8
[mysqld]
character-set-server = utf8
1、apt安装:sudo apt-get install mysql-server
2、下载源码安装:http://dev.mysql.com/downloads/mysql/5.6.html#downloads
3、解决中文乱码:修改my.cnf,加入
[client]
default-character-set = utf8
[mysqld]
character-set-server = utf8
重启mysql: service mysql restart / service mysqld restart / /etc/init.d/mysqld restart
4、进入mysql: mysql -uroot -p ,show variables like 'chra%' 查看是否都是utf8
5、查看当前数据库编码:use 数据库名; status;