1.下載4個rpm包
mysql-community-client-5.7.26-1.el7.x86_64.rpm mysql-community-common-5.7.26-1.el7.x86_64.rpm mysql-community-libs-5.7.26-1.el7.x86_64.rpm mysql-community-server-5.7.26-1.el7.x86_64.rpm
想要用迅雷進行下載得先找到對應的rpm下載路徑
首先瀏覽器開啟mysql官網:
在開啟的介面,按鍵盤f12 開啟開發者工具,開啟後如下:
在官網找到對應的版本:
點選直接下載:
在開發者工具就能找到下載路徑:
如下給了4個myql5.7 的rpm包的路徑,直接打開迅雷填入下載路徑就可以進行下載,其他版本可以用同樣方法:
https://cdn. mysql.com//downloads/mysql-5.7/mysql-community-server-5.7.26-1.el7.x86_64.rpm
https://cdn.mysql.com//downloads/mysql-5.7 /mysql-community-client-5.7.26-1.el7.x86_64.rpm
https://cdn.mysql.com//downloads/mysql-5.7/mysql-community-common-5.7.26 -1.el7.x86_64.rpm
https://cdn.mysql.com//downloads/mysql-5.7/mysql-community-libs-5.7.26-1.el7.x86_64.rpm
2.上傳rpm到linux
我這裡用的xshell,沒有安裝xftp
在sftp輸入put指令,選擇下載好的rpm包即可上傳:
3.安裝
已經上傳好的rpm如下:
透過 rpm -ivhmysql-community-****-5.7.26-1.el7.x86_64.rpm--force --nodeps
進行安裝,***表示common 、libs、client、server
安裝順序common-->libs-->client-->server
如果沒有--force -- nodeps會出現警告:
warning: mysql-community-common-5.7.26-1.el7.x86_64.rpm: header v3 dsa/sha1 signature, key id 5072e1f5: nokey
[root@localhost ~]# service mysqld start redirecting to /bin/systemctl start mysqld.service [root@localhost ~]#
[root@localhost ~]# cat /var/log/mysqld.log |grep password 2019-06-02t08:39:38.448115z 1 [note] a temporary password is generated for root@localhost: dlzmcrv?s2q) 2019-06-02t08:40:41.870130z 2 [note] access denied for user 'root'@'localhost' (using password: no)
mysql> grant all privileges on *.* to 'root'@'%' identified by 'newpasswd' with grant option; mysql> flush peivleges;
以上是centos7使用rpm安裝mysql5.7的方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!