rhel、centos、fedora使用yum安裝mysql community server

來源:互聯網
上載者:User

標籤:mysql redhat

  1. 在mysql官方連結中下載redhat系列的相應版本的升級包:

    http://dev.mysql.com/downloads/repo/yum/


  2. redhat中root使用者執行:rpm -Uvh mysql-community-release-el****.noarch.rpm


  3. 查看支援升級安裝的mysql版本:

    [[email protected] ~]# yum repolist all | grep mysql

    mysql-connectors-community        MySQL Connectors Community      enabled:     5

    mysql-connectors-community-source MySQL Connectors Community - So disabled

    mysql56-community                 MySQL 5.6 Community Server      enabled:    94

    mysql56-community-source          MySQL 5.6 Community Server - So disabled

    mysql57-community-dmr             MySQL 5.7 Community Server Deve disabled

    mysql57-community-dmr-source      MySQL 5.7 Community Server Deve disabled


  4. [[email protected] ~]# yum install mysql-community-server

    ......

    Dependencies Resolved

    ==================================================================================

     Package                       Arch   Version           Repository           Size

    ==================================================================================

    Installing:

    mysql-community-server        i386   5.6.24-3.el5      mysql56-community    83 M

    Installing for dependencies:

    mysql                         i386   5.6.24-3.el5      mysql56-community    38 k

    mysql-community-client        i386   5.6.24-3.el5      mysql56-community    22 M

    mysql-community-common        i386   5.6.24-3.el5      mysql56-community   692 k

    mysql-community-libs          i386   5.6.24-3.el5      mysql56-community   2.3 M

    mysql-community-libs-compat   i386   5.6.24-3.el5      mysql56-community   2.0 M

    perl-DBI                      i386   1.52-2.el5        base                600 k


    Transaction Summary

    ==================================================================================

    Install       7 Package(s)

    Upgrade       0 Package(s)


    Total download size: 111 M

    Is this ok [y/N]: y

    Downloading Packages:

    (1/7): mysql-5.6.24-3.el5.i386.rpm                         |  38 kB     00:02     

    (2/7): perl-DBI-1.52-2.el5.i386.rpm                        | 600 kB     00:11     

    (3/7): mysql-community-common-5.6.24-3.el5.i386.rpm        | 692 kB     00:17     

    (4/7): mysql-community-libs-compat-5.6.24-3.el5.i386.rpm   | 2.0 MB     00:51     

    (5/7): mysql-community-libs-5.6.24-3.el5.i386.rpm          | 2.3 MB     01:12     

    (6/7): mysql-community-client-5.6.24-3.el5.i386.rpm        |  22 MB     06:58     

    (7/7): mysql-community-server-5.6.24-3.el5.i386.rpm        |  83 MB     13:29     

    ----------------------------------------------------------------------------------

    Total                                              82 kB/s | 111 MB     23:07     

    warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID 5072e1f5

    mysql56-community/gpgkey                                   | 2.1 kB     00:00     

    Importing GPG key 0x5072E1F5 "MySQL Release Engineering <[email protected]>" from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

    Is this ok [y/N]: y

    warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

    base/gpgkey                                                | 1.5 kB     00:00     

    Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <[email protected]>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

    Is this ok [y/N]: y

    Running rpm_check_debug

    Running Transaction Test

    Finished Transaction Test

    Transaction Test Succeeded

    Running Transaction

      Installing     : perl-DBI                                                   1/7 

      Installing     : mysql-community-libs                                       2/7 

      Installing     : mysql-community-common                                     3/7 

      Installing     : mysql-community-client                                     4/7 

      Installing     : mysql-community-libs-compat                                5/7 

      Installing     : mysql-community-server                                     6/7 

    warning: user mysql does not exist - using root

    warning: user mysql does not exist - using root

      Installing     : mysql                                                      7/7 


    Installed:

      mysql-community-server.i386 0:5.6.24-3.el5

    Dependency Installed:

      mysql.i386 0:5.6.24-3.el5                                                       

      mysql-community-client.i386 0:5.6.24-3.el5                                      

      mysql-community-common.i386 0:5.6.24-3.el5                                      

      mysql-community-libs.i386 0:5.6.24-3.el5                                        

      mysql-community-libs-compat.i386 0:5.6.24-3.el5                                 

      perl-DBI.i386 0:1.52-2.el5                                                      


    Complete!


  5. 添加mysql使用者:

    useradd -g mysql mysql


  6. 關鍵目錄改變屬主許可權

    chown -R mysql:mysql /var/run/mysqld

    chown -R mysql:mysql /var/lib/mysql


  7. 建立基礎user表

    mysql_install_db --user=mysql --ldata=/var/lib/mysql


  8. 啟動、停止mysql server:

    service mysqld start/status/stop

rhel、centos、fedora使用yum安裝mysql community server

聯繫我們

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