CentOS7 yum安裝 MySql

1.下載yum 源

wgethttps://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm

# 鏈接在這里找https://dev.mysql.com/downloads/repo/yum/

2.安裝 yum 源

sudo rpm -Uvh mysql57-community-release-el7-11.noarch.rpm

3.顯示所有的 GA 版本

yum repolist all | grep mysql

4.選擇安裝的版本

sudo yum-config-manager --disable mysql57-community

sudo yum-config-manager --enable mysql56-community

如果遇到sudo:yum-config-manager:找不到命令

yum -y install yum-utils

yum repolist enabled | grep mysql

5.安裝

sudo yum install mysql-community-server

6.啟動(dòng) Mysql Server

sudo service mysqld start

sudo systemctl start mysqld.service

sudo service mysqld status

sudo systemctl status mysqld.service

7.MySQL Server Initialization (for MySQL 5.7 only):

A superuser account?'root'@'localhost'?is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command:

sudo grep 'temporary password' /var/log/mysqld.log

其他版本沒(méi)有密碼

8.修改密碼

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

可能會(huì)報(bào)一下錯(cuò)誤,5.7版本必須包含大小寫字母,數(shù)字和特殊字符

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容