【linux mysql】mysql 8.0.23 版本快速3分钟安装

1、下载安装mysql 、启动

wget https://repo.mysql.com/yum/mysql-8.0-community/el/7/x86_64/mysql80-community-release-el7-3.noarch.rpm

rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
yum --enablerepo=mysql80-community install -y mysql-community-server
yum install -y mysql-community-client

systemctl restart mysqld
systemctl enable mysqld

2、查看临时密码

 grep "A temporary password" /var/log/mysqld.log

3、 用临时密码修改新密码,设置新密码

mysql_secure_installation

4、用新密码登录,开启远程访问,navicat能连接

mysql -u root -p
输入新密码
use mysql
update user set host='%' where user='root';
#刷新权限
flush privileges;

5、开启防火墙并且开放3306端口

firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
firewall-cmd --zone=public --list-ports
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页