Rocky Linux 9安裝MySQL8

官網(wǎng)下載地址
根據(jù)自己的系統(tǒng)版本挑選不同的MySQL版本
https://dev.mysql.com/downloads/mysql/
系統(tǒng)依賴
dnf install -y perl libtirpc net-tools wget tar
下載MySQL安裝包
我這里選擇的是Red Hat Enterprise Linux / Oracle Linux MySQL 8.1.0,這是 MySQL 變更發(fā)版模型后的第一個創(chuàng)新版本 (Innovation Release)?當(dāng)時沒反應(yīng)過來……
wget https://cdn.mysql.com//Downloads/MySQL-8.1/mysql-8.1.0-1.el9.x86_64.rpm-bundle.tar
解壓MySQL安裝包壓縮文件
tar -xvf mysql-8.1.0-1.el9.x86_64.rpm-bundle.tar
安裝順序?
1.mysql-community-common
2.mysql-community-client-plugins
3.mysql-community-libs
4.mysql-community-icu-data-files
5.mysql-community-client
6.mysql-community-server
rpm -ivh mysql-community-common-8.1.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.1.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-libs-8.1.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-icu-data-files-8.1.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-client-8.1.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-server-8.1.0-1.el9.x86_64.rpm
## MySQL 初始化
mysqld --initialize --console
## 設(shè)置MySQL用戶權(quán)限
chown -R mysql:mysql /var/lib/mysql
## 通過日志文件查看root賬戶臨時密碼
cat /var/log/mysqld.log | grep localhost
## 啟動MYSQL服務(wù)組件
systemctl enable mysqld && systemctl start mysqld
## 臨時ROOT密碼登陸 MYSQL
mysql -uroot -p'臨時密碼'
## 進入MySQL 更改ROOT賬戶密碼?
alter user 'root'@'localhost' identified by'密碼';