1.下載 4個(gè)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
想要用迅雷進(jìn)行下載得先找到對(duì)應(yīng)的rpm下載路徑
首先瀏覽器打開mysql官網(wǎng):https://dev.mysql.com/downloads/mysql/5.7.html
在打開的界面,按鍵盤 F12 打開開發(fā)者工具,打開后如下:
在官網(wǎng)找到對(duì)應(yīng)的版本:
點(diǎn)擊直接下載:
在開發(fā)者工具就能找到下載路徑:
如下給出了4個(gè)myql5.7 的rpm包的路徑,直接打開迅雷填入下載路徑就可以進(jìn)行下載,其他版本可以用同樣方法:
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.安裝
已經(jīng)上傳好的rpm如下:
通過 rpm -ivhmysql-community-****-5.7.26-1.el7.x86_64.rpm--force --nodeps
進(jìn)行安裝,***表示common 、libs、client、server
安裝順序 common-->libs-->client-->server
如果沒有--force --nodeps會(huì)出現(xiàn)告警:
warning: mysql-community-common-5.7.26-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
4.配置
啟動(dòng)mysql服務(wù) :
[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:
[root@localhost ~]# mysql -u root -p
密碼為上面找到的dLZMCRv?s2q)
修改root密碼:
mysql> alter user 'root'@'localhost' identified by 'newpasswd';
允許遠(yuǎn)程連接:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'newpasswd' WITH GRANT OPTION;
mysql> FLUSH PEIVLEGES;
關(guān)閉防火墻:
[root@localhost ~]# systemctl stop firewalld.service
總結(jié)
以上所述是小編給大家介紹的centos7使用rpm安裝mysql5.7的教程圖解,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!