MySQL資料庫系列之Centos6.5系統下RPM包安裝MySQL5.6

來源:互聯網
上載者:User

標籤:資料庫   資訊   作業系統   下載安裝   

  1. 查看作業系統相關資訊。

[[email protected]_db1 ~]# cat /etc/issueCentOS release 6.5 (Final)Kernel \r on an \m[[email protected]_db1 ~]# uname -aLinux bj_db1 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

2.建立需要下載rpm軟體包的目錄。

[[email protected]_db1 ~]# mkdir -p /taokey/tools

3.查看下是否有系統內建mysql的rpm包,如果有,需要刪除內建的舊rpm包。

[[email protected]_db1 ~]# rpm -qa | grep mysqlmysql-libs-5.1.71-1.el6.x86_64[[email protected]_db1 ~]# yum -y remove mysql-libs-5.1*[[email protected]_db1 ~]# rpm -qa | grep mysql[[email protected]_db1 ~]#

4.在MySQL官網下載安裝MySQL-5.6.21所需的rpm軟體包。

需要下載三個rpm軟體包:

MySQL-client-5.6.21-1.rhel5.x86_64.rpm  MySQL-devel-5.6.21-1.rhel5.x86_64.rpm  MySQL-server-5.6.21-1.rhel5.x86_64.rpm[[email protected]_db1 ~]# cd /taokey/tools/[[email protected]_db1 tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm[[email protected]_db1 tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm[[email protected]_db1 tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm

5.下載完之後,安裝三個rpm軟體包。

[[email protected]_db1 tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm 

error: Failed dependencies:

        libaio.so.1()(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64

        libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64

        libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64

安裝MySQL-server報錯,原因是沒有安裝libaio,系統缺少libaio.so此軟體包,下邊yum安裝一下libaio.so軟體包。

[[email protected]_db1 tools]# yum install -y libaio[[email protected]_db1 tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm[[email protected]_db1 tools]# rpm -ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm Preparing...                ########################################### [100%]   1:MySQL-client           ########################################### [100%][[email protected]_db1 tools]# rpm -ivh MySQL-devel-5.6.21-1.rhel5.x86_64.rpm Preparing...                ########################################### [100%]   1:MySQL-devel            ########################################### [100%]

6.修改設定檔位置。

[[email protected]_db1 tools]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf

7.初始化MySQL及修改MySQL預設的root密碼。

[[email protected]_db1 tools]# /usr/bin/mysql_install_db[[email protected]_db1 tools]# ps -ef | grep mysqlroot      2188     1  0 14:48 pts/1    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/bj_db1.pidmysql     2303  2188 30 14:48 pts/1    00:00:02 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/bj_db1.err --pid-file=/var/lib/mysql/bj_db1.pidroot      2331  1853  0 14:49 pts/1    00:00:00 grep mysql[[email protected]_db1 tools]# netstat -anpt | grep 3306tcp        0      0 :::3306                     :::*                        LISTEN      2303/mysqld[[email protected]_db1 tools]# more /root/.mysql_secret# The random password set for the root user at Thu Apr  9 14:43:59 2015 (local time): F6K3v_xggFoLQeiN[[email protected]_db1 tools]# mysql -uroot -pF6K3v_xggFoLQeiNWarning: Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.6.21Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql> SET PASSWORD = PASSWORD(‘123.com‘); mysql> exitBye[[email protected]_db1 tools]# mysql -uroot -p123.comWarning: Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 6Server version: 5.6.21 MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql>

8.設定MySQL服務開機自啟動。

[[email protected]_db1 tools]# chkconfig mysql on[[email protected]_db1 tools]# chkconfig mysql --listmysql           0:off   1:off   2:on    3:on    4:on    5:on    6:off

到此為止,使用RPM安裝MySQL5.6版本資料庫安裝完畢,謝謝大家。

本文出自 “歲月在流逝,光輝依然在” 部落格,請務必保留此出處http://taokey.blog.51cto.com/4633273/1630561

MySQL資料庫系列之Centos6.5系統下RPM包安裝MySQL5.6

聯繫我們

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