Fedora安裝mysql數據庫

下載MySQL5.7.9 yum倉庫

wget https://dev.mysql.com/get/mysql57-community-release-fc23-7-noarch.rpm

 

rpm -ivh mysql57-community-release-fc23-7-noarch.rpm

驗證倉庫

yum repolist enable | grep "mysql.*-community.*"

 

安裝

yum install mysql-community-server

 

啟動mysql服務

service mysql start

 

查看mysql服務狀態

service mysql status

 

獲取臨時密碼

cat /var/log/mysql.log | grep "A temporary password"

 

修改密碼

mysqladmin –uroot –p 'temp passwd' password 'new passwd'

 

登陸mysql

mysqladmin –user=XXX –password=XXX

You May Also Like