下面講講關(guān)于centos 6.9 下rpm方式如何安裝mysql,文字的奧妙在于貼近主題相關(guān)。所以,閑話就不談了,我們直接看下文吧,相信看完centos 6.9 下rpm方式如何安裝mysql這篇文章你一定會(huì)有所受益。
蓬溪ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!在centos 6.9 上rpm安裝mysql
環(huán)境:
Linux:CentOS release 6.9 64bit
MySQL: mysq-5.7.18
1、在/home創(chuàng)建mysql目錄,下載如下四個(gè)軟件包
http://mirrors.sohu.com/mysql/MySQL-5.7/
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-client-5.7.18-1.el6.x86_64.rpm
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-common-5.7.18-1.el6.x86_64.rpm
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-libs-5.7.18-1.el6.x86_64.rpm
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-server-5.7.18-1.el6.x86_64.rpm
2、檢查mysql rpm相關(guān)的包是否安裝并去除
[root@centos-6 mysql]# rpm -qa | grep -i mysql
mysql-libs-5.1.73-8.el6_8.x86_64
[root@centos-6 mysql]# rpm -e mysql-libs-5.1.73-8.el6_8.x86_64
error: Failed dependencies:
libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-8.el6.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-8.el6.x86_64
mysql-libs is needed by (installed) postfix-2:2.6.6-8.el6.x86_64
[root@centos-6 mysql]#
將依賴包一并刪除
[root@centos-6 mysql]# yum remove -y mysql-libs
再次查詢是否刪除干凈
[root@centos-6 mysql]# rpm -qa | grep -i mysql
[root@centos-6 mysql]#
3、同時(shí)安裝這四個(gè)rpm包
rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm mysql-community-common-5.7.18-1.el6.x86_64.rpm mysql-community-libs-5.7.18-1.el6.x86_64.rpm mysql-community-server-5.7.18-1.el6.x86_64.rpm
4、出現(xiàn)缺少依賴包解決方式
[root@centos-6 home]# rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm mysql-community-common-5.7.18-1.el6.x86_64.rpm mysql-community-libs-5.7.18-1.el6.x86_64.rpm mysql-community-server-5.7.18-1.el6.x86_64.rpm
warning: mysql-community-client-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64
libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64
libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64
[root@centos-6 home]# yum install -y numactl
5、密碼獲取
第一次通過#grep "password" /var/log/mysqld.log 命令獲取MySQL的臨時(shí)密碼
用該密碼登錄到服務(wù)端后,必須馬上修改密碼,不然操作查詢時(shí)報(bào)錯(cuò)誤
剛開始設(shè)置的密碼必須符合長度,且必須含有數(shù)字,小寫或大寫字母,特殊字符。
如果想設(shè)置簡單密碼,如下操作:
首先,修改validate_password_policy參數(shù)的值
mysql> set global validate_password_policy=0; #定義復(fù)雜度
mysql> set global validate_password_length=1; #定義長度 默認(rèn)是8
mysql>set password for 'root'@'localhost'=password('123456'); #設(shè)置root密碼為123456
mysql> flush privileges; #刷新權(quán)限使配置生效
對(duì)于以上centos 6.9 下rpm方式如何安裝mysql相關(guān)內(nèi)容,大家還有什么不明白的地方嗎?或者想要了解更多相關(guān),可以繼續(xù)關(guān)注我們的行業(yè)資訊板塊。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。