问题:为了可以存储中文汉字,解决中文乱码,需要将数据库的字符集改为utf8
解决:
1,在MySQL下查看字符集
show variables like 'character%';
2,如果除了character_set_filesystem不是utf8,还有其他不为utf8,进行修改
vim /etc/my.cnf
3,在my.cnf里加入character_set_server=utf8,保存
4,重启数据库
service mysqld restart
5,进入mysql查看字符集
show variables like 'character%';
6,除了character_set_filesystem不是utf8,其他都为utf8