rhel7.5上通过yum安装 mysql8.0.11
1.增加 MySQL Yum Repository
到以下位置去下载 MySQL Yum Repository 包
https://dev.mysql.com/downloads/repo/yum/
Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package 25.2K
(mysql80-community-release-el7-1.noarch.rpm)
下载 MySQL Yum Repository
安装 MySQL Yum Repository
yum localinstall mysql80-community-release-el7-1.noarch.rpm
2.检查成功安装的mysql yum仓库
[root@dbserver ~]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community 51
mysql-tools-community/x86_64 MySQL Tools Community 63
mysql80-community/x86_64 MySQL 8.0 Community Server 17
3.Installing MySQL
yum install mysql-community-server
mysql-community-server:MySQL server
mysql-community-client:MySQL client
mysql-community-common:common error messages and character sets for client and server
mysql-community-libs: shared client libraries.
=================== ================== =======================
Package Arch Version
Installing:
mysql-community-libs x86_64 8.0.11-1.el7
mysql-community-libs-compat x86_64 8.0.11-1.el7 mysql-community-server x86_64 8.0.11-1.el7
Installing for dependencies:
mysql-community-client x86_64 8.0.11-1.el7
mysql-community-common x86_64 8.0.11-1.el7
4.启动 MySQL Server
systemctl start mysqld
--查找root的密码:
grep 'temporary password' /var/log/mysqld.log
--修改root的密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySztech123!';
-- allow remote client access mysql.
UPDATE user SET Host='%' WHERE User='root' AND Host='localhost' LIMIT 1;
5.安装其他mysql
yum install mysql-workbench-community
需要注意,rhel7.5默认是开启了防火墙。
因此,如果需要远程访问,需要设置防火墙,运行mysql
firewall-cmd --permanent --add-service=mysql
firewall-cmd --reload
firewall-cmd --list-all
就可以了。