CentOS7下安裝MySQL5.7.39的詳細(xì)過程
一、下載
下載地址:https://dev.mysql.com/downloads/mysql/

二、解壓
tar xvf mysql-5.7.39-1.el7.x86_64.rpm-bundle.tar
三、卸載已安裝包
rpm -qa|grep mariadb mariadb-libs-5.5.68-1.el7.x86_64
rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
四、按順序安裝rpm包
rpm -ivh mysql-community-common-5.7.39-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-5.7.39-1.el7.x86_64.rpm rpm -ivh mysql-community-client-5.7.39-1.el7.x86_64.rpm // 如果安裝 mysql-community-server-5.7.39-1.el7 報 libaio.so.1 依賴錯誤,需先安裝 libaio-0.3.109-13.el7.x86_64.rpm rpm -ivh libaio-0.3.109-13.el7.x86_64.rpm rpm -ivh mysql-community-server-5.7.39-1.el7.x86_64.rpm
安裝 server 還可能報錯:
rpm -ivh mysql-community-server-5.7.39-1.el7.x86_64.rpm warning: mysql-community-server-5.7.39-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY error: Failed dependencies: net-tools is needed by mysql-community-server-5.7.39-1.el7.x86_64
執(zhí)行以下命令安裝 net-tools 解決:
yum install net-tools -y
五、啟動
systemctl start mysqld
六、找到初始密碼
cat /var/log/mysqld.log | grep 'password is generated'

七、修改密碼并授權(quán)
alter user 'root'@'localhost' identified by 'xxxxxx'; grant all privileges on *.* to 'root'@'%' identified by 'xxxxxx' with grant option; flush privileges;
八、開啟防火墻,允許外網(wǎng)訪問
firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --reload firewall-cmd --list-ports
到此這篇關(guān)于CentOS7下安裝MySQL5.7.39的文章就介紹到這了,更多相關(guān)CentOS7安裝MySQL5.7.39內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
在idea中使用mysql數(shù)據(jù)庫超詳細(xì)教程
這篇文章主要介紹了如何在IntelliJ IDEA中連接MySQL數(shù)據(jù)庫,并使用控制臺執(zhí)行SQL語句,還詳細(xì)講解了如何使用MyBatis Generator快速生成實(shí)體類、接口和SQL文件,以及如何解決Lombok依賴問題,需要的朋友可以參考下2025-02-02
Navicat for MySQL 15注冊激活詳細(xì)教程
這篇文章主要介紹了Navicat for MySQL 15注冊激活詳細(xì)教程,本文通過圖文并茂的形式給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-12-12
MyEclipse連接MySQL數(shù)據(jù)庫報錯解決辦法
我們現(xiàn)在一般網(wǎng)站都是利用的MySQL數(shù)據(jù)庫搭建網(wǎng)站的,但是在網(wǎng)上看到很多網(wǎng)友吐槽數(shù)據(jù)庫連接不上的問題,現(xiàn)在我就結(jié)合相關(guān)資料向提出一些我個人的見解,希望對大家解決問題有幫助2014-01-01
MySQL出現(xiàn)Waiting for table metadata lock異常
當(dāng)MySQL使用時出行Waiting for table metadata lock異常時該怎么辦呢?這篇文章就來和大家講講解決辦法,感興趣的小伙伴可以了解一下2023-04-04
MYSQL存儲過程即常用邏輯知識點(diǎn)總結(jié)
在本篇文章里小編給大家整理的是關(guān)于MYSQL存儲過程即常用邏輯知識點(diǎn),有需要的朋友們可以學(xué)習(xí)下。2019-08-08

