MySQL8.0.11安裝總結
安裝環境:
CAT /etc/os-release 檢視centos系統版本資訊;
getconf LONG_BIT 獲取慚怍系統位數
系統為 64位 centos 7
配置安裝源:
rpm -Uvh https://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
yum --enablerepo=mysql80-community install mysql-community-server
啟動mysql服務
systemctl start mysqld.service
或者
service mysqld start
mysql 服務狀態:
systemctl status mysqld
或者
service mysqld status 實際上也是會轉換為systemctl status mysqld去獲取狀態
檢視mysql root 臨時密碼
grep "A temporary password" /var/log/mysqld.log
根據臨時密碼重置新密碼和密碼策略
mysql_secure_installation ;
Password Policy:
按照提示步驟一步步完成;
設定可以遠端連線
firewall-cmd --add-port=3306/tcp --permanent 開放資料庫訪問埠 tcp 協議
firewall-cmd --reload 重新載入防火牆資訊
firewall-cmd --list-ports 檢視開放的埠資訊
lsof -i:3306 驗證
mysql 客戶端登入驗證
檢視版本:
有的客戶端連線會出現 error 2059錯誤
主要解決方案:
更改default_authentication_plugin = mysql_native_password
vim /etc/my.cnf
重啟服務就可以連線了;有可能沒有重啟成功;(如果不行 應該為1045,可能作業系統預設連線為127.0.0.1,不是localhost導致連線不上,更改使用者Host
use mysql; update user set Host='%' where User='root';windows 客戶端連線時出現, 這種應該和 error 2059: Authentication plugin 'caching_sha2_password' can not be loaded '----' 無關 );
安裝的時候可以明顯感覺到MySQL8.0 新特性 安全屬性提高非常多;