linux config

yum update -y

yum install wget -y

yum list mysql*

yum install mysql-server* -y

yum list java*

yum install java-1.8.0-openjdk* -y

java -version

cd /usr/local

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

yum install mysql-community-server -y

service mysqld restart

mysql -uroot

set password for 'root'@'localhost' = password('Zaq12wsx');

cd /usr/local

wget http://apache.fayea.com/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24.tar.gz

tar -zxvf  apache-tomcat-8.0.24.tar.gz

mv apache-tomcat-8.0.24 tomcat

chmod -R 777 tomcat/

1、在[client]字段里加入default-character-set=utf8,如下:
<br style="padding:0px;margin:0px;" />[client]<br style="padding:0px;margin:0px;" />port = 3306<br style="padding:0px;margin:0px;" />socket = /var/lib/mysql/mysql.sock<br style="padding:0px;margin:0px;" />default-character-set=utf8<br style="padding:0px;margin:0px;" />
2、在[mysqld]字段里加入character-set-server=utf8,如下:
<br style="padding:0px;margin:0px;" />[mysqld]<br style="padding:0px;margin:0px;" />port = 3306<br style="padding:0px;margin:0px;" />socket = /var/lib/mysql/mysql.sock<br style="padding:0px;margin:0px;" />character-set-server=utf8<br style="padding:0px;margin:0px;" />
3、在[mysql]字段里加入default-character-set=utf8,如下:
<br style="padding:0px;margin:0px;" />[mysql]<br style="padding:0px;margin:0px;" />no-auto-rehash<br style="padding:0px;margin:0px;" />default-character-set=utf8<br style="padding:0px;margin:0px;" />
修改完成后,service mysql restart重启mysql服务就生效。注意:[mysqld]字段与[mysql]字段是有区别的。这点在网上没人反馈过。

相关推荐