- 随手整理了下,步骤没有写命令注释,已经跑通
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
rpm -ivh mysql80-community-release-el7-1.noarch.rpm
yum repolist all | grep mysql
yum repolist enabled | grep mysql
yum install mysql-community-server
- 一路选择
y
service mysqld restart
grep 'temporary password' /var/log/mysqld.log
记住密码(:后面的字符串service mysqld start
10.mysql -u root -p
11.刚刚的随机密码
12.alter user 'root'@'%' identified by 'Lwlzq123456..';
(更会密码:大写小写标点)
13.CREATE USER 'lwl'@'%' IDENTIFIED WITH mysql_native_password BY 'Lwlzq123456..!';
14.GRANT ALL PRIVILEGES ON *.* TO 'lwl'@'%';
15 13-14 添加远程访问用户,mysql 8.0 不支持root 远程访问;
16.FLUSH PRIVILEGES;
(刷新)
17.exit
18.firewall-cmd --zone=public --add-port=3306/tcp --permanent
19.firewall-cmd --reload
20.18-19 添加 3306 端口便重新启动防火墙
21.systemctl restart mysqld
(重新启动mysql服务);
22.我也是参考:其他博客然后去掉繁琐的步骤,并添加远程访问步骤 借鉴博客地址:https://www.cnblogs.com/rose0705/articles/9484511.html
linux 安装mysql 8.0
最新推荐文章于 2023-10-26 00:32:22 发布