Linux(CentOS)安装Mysql8.0

From: Linux(CentOS)安装Mysql8.0

1.官网下载Mysql安装源:Mysql8.0

wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm

2.安装Mysql源

yum -y install mysql80-community-release-el7-3.noarch.rpm

3.安装Mysql

yum -y install mysql-community-server

4.启动Mysql

service mysqld start

6.停止Mysql

service mysqld stop

6.查看Mysql运行状态

service mysqld status

7.查看初始密码

sudo grep ‘temporary password’ /var/log/mysqld.log

8.登录Mysql

mysql -uroot -p

9.修改root登录密码[mysql8.0以上密码策略限制必须要大小写加数字特殊符号]

alter user’root’@‘localhost’ identified with mysql_native_password by ‘新密码’;

10.修改Mysql访问限制

update user set Host =’%’ where User = “root”;

11.刷新Mysql

flush privileges;

12.新增用户

create user ‘yiiwang’@’%’ identified by ‘密码’;
Mysql8.0默认使用caching_sha2_password加密

13.赋值权限

grant all on *.* to ‘yiiwang’@’%’ ;

14.设置自动启动

systemctl enable mysqld
systemctl daemon-reload

你可能感兴趣的:(环境搭建)