0
点赞
收藏
分享

微信扫一扫

CentOS7使用rpm包安装MySQL8.0

kmoon_b426 2022-01-14 阅读 65

1、下载yum源的安装包

yum install https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm 

2、安装

yum install mysql-community-server

3、启动服务

systemctl start mysqld

4、查看状态

systemctl status mysqld

5、查看初始密码

grep 'temporary password' /var/log/mysqld.log

6、登录

mysql -uroot -p

7、更改密码
密码最好组合数字,大小写字母,特殊符号。修改好后退出。

alter user 'root'@'localhost' identified by 'xxxxx';

通过新密码再次登陆验证密码是否修改成功。

mysql -uroot -p

8、创建远程访问用户,依次执行下列命令

create user 'root'@'%' identified with mysql_native_password by 'xxxxx';

grant all privileges on *.* to 'root'@'%' with grant option;

flush privileges;
举报

相关推荐

0 条评论