Linux CentOS安裝配置MySQL5.7資料庫

來源:互聯網
上載者:User

標籤:gpo   rpm   rest   oar   uri   /etc/   local   complete   .com   

安裝mysql資料庫

  a)下載mysql源安裝包:wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

  b)安裝mysql源:yum localinstall mysql57-community-release-el7-8.noarch.rpm

    若結尾出現complete!,則說明MySQL源安裝完成

   c)檢測是否安裝完成:yum repolist enabled | grep "mysql.-community."

  

  d)安裝mysql:yum install mysql-community-server

    若結尾出現Complete!, 則MySQL安裝完成

  e)設定開啟啟動mysql服務:systemctl enable mysqld

  f)查看安裝的mysql版本:rpm -aq | grep -i mysql

    

  g)啟動MySQL服務:systemctl restart mysqld

  h)查看MySQL初始密碼:grep ‘A temporary password‘ /var/log/mysqld.log

    

  i)更改MySQL密碼:mysqladmin -u root -p‘舊密碼‘ password ‘新密碼‘

    

    這裡更改密碼出了問題,更改失敗,這是因為密碼太過簡單的原因。有兩個接解決方案:

    方法一:把密碼設定複雜點(這是最直接的方法)

    方法二:關閉mysql密碼強度驗證(validate_password)

        編輯設定檔:vim /etc/my.cnf, 增加這麼一行validate_password=off

        編輯後重啟mysql服務:systemctl restart mysqld

  j)設定mysql能夠遠端存取:

    登入進MySQL:mysql -uroot -p密碼

    增加一個使用者給予存取權限:grant all privileges on . to ‘root‘@‘ip地址‘ identified by ‘密碼‘ with grant option; //可將ip改為%%,表示開啟所有的

Linux CentOS安裝配置MySQL5.7資料庫

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.