mysql 乱码问题
Ubuntu 上这样操作
1.关闭mysql服务
sudo /etc/init.d/mysql stop
2.vi编辑器打开/etc/mysql/my.cnf文件 sudo vim /etc/mysql/my.cnf
sudo vi /etc/my.cnf
sudo vim /etc/mysql/my.cnf
添加下面的命令
[client]
default-character-set=utf8
[server]
default-character-set=utf8
[mysql]
default-character-set=utf8
--重启mysql服务
sudo /etc/init.d/mysql restart
--查看mysql字符编码
show variables like 'character%';
--把/etc/mysql/my.cnf copt /etc/my.cnf(如果存在,会覆盖)
sudo cp /etc/mysql/my.cnf /etc/my.cnf
--在tomcat目录bin下执行启动tomcat服务
./startup.sh start
CentOS上把default-character-set=utf8 换成character-set-server=utf8
相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11
世樹 2020-11-11