1.下载、安装
### 下载MySQL官方的 Yum Repository
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
### 安装MySQL官方的 Yum Repository
yum -y install mysql57-community-release-el7-10.noarch.rpm
### 安装mysql-community
yum -y install mysql-community-server
2.启动服务并查看状态
systemctl start mysqld.service
systemctl status mysqld.service
3.查看初始密码,并修改
grep "password" /var/log/mysqld.log
### 登录mysql
mysql -u root -p
### 修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
4.开启mysql远程访问
### 开启远程访问
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
### 刷新
flush privileges;
exit;
5.修改mysql字符编码
5.1 查看字符编码
show variables like '%character%';
5.2 退出mysql,修改参数
修改 /etc/my.cnf
[mysqld]
character_set_server=utf8
init_connect='SET NAMES utf8'
重启Mysql
systemctl restart mysqld