Liunx環境安裝Mysql

來源:互聯網
上載者:User

標籤:1.3   yum   star   password   mmu   i686   har   linux   word   

 1.1  查看mysql的安裝路徑:

[[email protected] ~]# whereis mysql

mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

 

1.2  查看mysql的安裝包:

[[email protected] ~]# rpm -qa|grep mysql

mysql-community-client-5.6.26-2.el6.i686

mysql-community-release-el6-5.noarch

mysql-community-common-5.6.26-2.el6.i686

mysql-community-libs-5.6.26-2.el6.i686

mysql-community-server-5.6.26-2.el6.i686

 

1.3  卸載mysql

[[email protected] ~]# yum remove mysql

 

刪除mysql的資料庫檔案:

刪除/var/llib/mysql目錄

 

1.4  安裝mysql

第一步:從oracle官方網站下載linux系統對應的mysql的yum源包。

 

第二步:把yum源包上傳到linux,安裝。

[[email protected] ~]# yum localinstall mysql-community-release-el6-5.noarch.rpm

[[email protected] ~]# yum install mysql-server

 

第三步:啟動mysql

[[email protected] ~]# service mysqld start

 

第四步:給root使用者佈建密碼

[[email protected] ~]# /usr/bin/mysqladmin -u root password ‘root‘

 

第五步:遠端連線授權

GRANT ALL PRIVILEGES ON *.* TO ‘myuser‘@‘%‘ IDENTIFIED BY ‘mypassword‘ WITH GRANT OPTION;

 

注意:‘myuser‘、‘mypassword‘ 需要替換成實際的使用者名稱和密碼。

 

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘root‘ WITH GRANT OPTION;

 

Liunx環境安裝Mysql

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.