在本人寫做這篇安裝MySQL文章時,雖然MySQL已經發布到8.0.17版本,但對於行業來講,主力版本依然是5.7版本。目前在Linux環境默認安裝時,大部分已經默認安裝到8版本了,因此本人特地寫一篇安裝5.7版本的記錄,用於幫助新手朋友及本人之後用到。mysql
[root@qinshengfei ~]# wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm複製代碼
[root@qinshengfei ~]#yum localinstall mysql57-community-release-el7-11.noarch.rpm複製代碼
[root@qinshengfei ~]# yum install -y mysql-community-server複製代碼
[root@qinshengfei ~]# service mysqld start複製代碼
[root@qinshengfei ~]# grep 'temporary password' /var/log/mysqld.log複製代碼
[root@qinshengfei ~]# mysql -u root -p複製代碼
mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'QWErt123!@#';複製代碼
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'QWErt123!@#' WITH GRANT OPTION;複製代碼
歡迎你們關注公衆號:一凡碼農redis