记录-安装mysql 8.0,centos7
2018-09-05 本文已影响0人
天马行空_d640
1. 下载安装需要的yum源
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
yum -Uvh mysql80-community-release-el7-1.noarch.rpm
安装后可以查看yum源
less /etc/yum.repos.d/mysql-community.repo
2.安装mysql
sudo yum install mysql-community-server
sudo systemctl start mysqld
sudo grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED BY '1qaz@WSX';
update user set host = '%' where user = 'root';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'wzk'@'%' IDENTIFIED BY '1qaz@WSX' WITH GRANT OPTION;
修改/etc/my.cnf配置文件,在[mysqld]下添加编码配置,如下所示:
[mysqld]
character_set_server=utf8
init_connect='SET NAMES utf8'
firewall-cmd --zone=public --add-port=3306/tcp --permanent