Install MySQL5.6 In the RPM package of CentOS6.5
1. View information about the operating system.
[Root @ bkjia ~] # Cat/etc/issue
CentOS release 6.5 (Final)
Kernel \ r on an \ m
[Root @ bkjia ~] # Uname-
Linux bkjia 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. Create a directory for downloading the rpm package.
1 [root @ bkjia ~] # Mkdir-p/taokey/tools
3. check whether there are rpm packages with built-in mysql. If yes, delete the old rpm packages.
[Root @ bkjia ~] # Rpm-qa | grep mysql
Mysql-libs-5.1.71-1.el6.x86_64
[Root @ bkjia ~] # Yum-y remove mysql-libs-5.1 *
[Root @ bkjia ~] # Rpm-qa | grep mysql
[Root @ bkjia ~] #
4. Download the rpm software package required to install the MySQL-5.6.21 on the MySQL website.
You need to download three rpm packages:
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
[Root @ bkjia ~] # Cd/taokey/tools/
[Root @ bkjia tools] # wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm
[Root @ bkjia tools] # wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
[Root @ bkjia tools] # wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm
5. install three rpm packages after the download.
[Root @ bkjia 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
When installing MySQL-server, an error is reported because libaio is not installed. The system lacks libaio. so. Install the libaio. so software package in yum.
[Root @ bkjia tools] # yum install-y libaio
[Root @ bkjia tools] # rpm-ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
[Root @ bkjia tools] # rpm-ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm
Preparing... ######################################## ### [100%]
1: mySQL-client ##################################### ###### [100%]
[Root @ bkjia tools] # rpm-ivh MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
Preparing... ######################################## ### [100%]
1: mySQL-devel ##################################### ###### [100%]
6. modify the configuration file location.
[Root @ bkjia tools] # cp/usr/share/mysql/my-default.cnf/etc/my. cnf
7. initialize MySQL and modify the Default root Password of MySQL.
[Root @ bkjia tools] #/usr/bin/mysql_install_db
[Root @ bkjia tools] # ps-ef | grep mysql
Root 2188 1 0 00:00:00 pts/1/bin/sh/usr/bin/mysqld_safe -- datadir =/var/lib/mysql -- pid-file =/var/lib/mysql/ bkjia. pid
Mysql 2303 2188 30 00:00:02 pts/1/usr/sbin/mysqld -- basedir =/usr -- datadir =/var/lib/mysql -- plugin-dir =/usr/lib64/mysql /plugin -- user = mysql -- log-error =/var/lib/mysql/bkjia. err -- pid-file =/var/lib/mysql/bkjia. pid
Root 2331 1853 0 00:00:00 pts/1 grep mysql
[Root @ bkjia tools] # netstat-anpt | grep 3306
Tcp 0 0: 3306: * LISTEN 2303/mysqld
[Root @ bkjia 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
[Root @ bkjia tools] # mysql-uroot-pF6K3v_xggFoLQeiN
Warning: 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 1
Server version: 5.6.21
Copyright (c) 2000,201 4, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql> set password = PASSWORD ('2017. com ');
Mysql> exit
Bye
[Root @ bkjia tools] # mysql-uroot -p123.com
Warning: 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 6
Server version: 5.6.21 MySQL Community Server (GPL)
Copyright (c) 2000,201 4, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql>
8. Set the MySQL service to start automatically.
[Root @ bkjia tools] # chkconfig mysql on
[Root @ bkjia tools] # chkconfig mysql -- list
Mysql 0: off 1: off 2: on 3: on 4: on 5: on 6: off
So far, I have installed MySQL5.6 database with RPM. Thank you.
Install MySQL 5.6.21 in CentOS 6.5
This article permanently updates the link address: