From:http://www.linuxidc.com/linux/2015-04/116003.htm
1. View information about the operating system.
[Email protected] ~]# cat/etc/issue CentOS release 6.5 (Final) Kernel \ r on an \m [[email protected] ~]# uname-a Linux LINUXIDC 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 03:15:09 UTC x86_64 x86_64 x86_64 gnu/linux
X86_64 is 64 bit, if you're not sure, you can change the command again.
#getconf Long_bit64
2. Create the directory where you want to download the RPM package.
1 [[Email protected] ~]# mkdir-p/taokey/tools
3. Check if there is a system with the MySQL RPM package, if any, you need to delete the old RPM package.
[Email protected] ~]# Rpm-qa | grep MySQL mysql-libs-5.1.71-1.el6.x86_64 [[email protected] ~]# yum-y remove mysql-libs-5.1* [[email protected] ~]# rpm -qa | grep MySQL [[email protected] ~]#
4. Download the RPM package required to install MySQL-5.6.21 on the MySQL website.
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
[Email protected] ~]# cd/taokey/tools/[[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/ mysql-server-5.6.21-1.rhel5.x86_64.rpm [[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/ mysql-devel-5.6.21-1.rhel5.x86_64.rpm [[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/ mysql-client-5.6.21-1.rhel5.x86_64.rpm
5. After downloading, install three RPM packages.
[Email protected] tools]# RPM-IVH mysql-server-5.6.21-1.rhel5.x86_64.rpm error:failed dependencies: libaio.so.1 () (64bit) are needed by mysql-server-5.6.21-1.rhel5.x86_64 libaio.so.1 (libaio_0.1) (64bit) are 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
Install Mysql-server error, the reason is not installed Libaio, the system is missing libaio.so this package, the bottom yum install libaio.so package.
[email protected] tools]# yum install-y libaio [[email protected] tools]# RPM-IVH MYSQL-SERVER-5.6.21-1.RHEL5.X86_64.RP m [[email protected] tools]# RPM-IVH mysql-client-5.6.21-1.rhel5.x86_64.rpm Preparing ... ########################################### [100%] 1:mysql-client ##################################### ###### [100%] [[email protected] 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.
[Email protected] tools]# CP/USR/SHARE/MYSQL/MY-DEFAULT.CNF/ETC/MY.CNF
7. Initialize MySQL and modify the default root password for MySQL.
[[email protected] tools]#/usr/bin/mysql_install_db [[email protected] tools]# Ps-ef | grep MySQL root 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/linuxidc.pid MySQL 2303 2188 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/linuxidc.err--pid-file=/ Var/lib/mysql/linuxidc.pid Root 2331 1853 0 14:49 pts/1 00:00:00 grep mysql [[email protected] tools]# Nets TAT-ANPT | grep 3306 TCP 0 0::: 3306:::* LISTEN 2303/mysqld[[email p Rotected] tools]# More/root/.mysql_secret # The random password set for the root user at Thu Apr 9 14:43:59 (Local Time): F6k3v_xggfolqein [[email protected] tools]# Mysql-uroot-pf6k3v_xggfolqein warning:using a password on the Command line interface can insecure. WelCome to the MySQL monitor. Commands End With; or \g. Your MySQL Connection ID is 1 Server version:5.6.21 Copyright (c), and Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of the Oracle Corporation and/or its affiliates. Other names trademarks of their respective owners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement. mysql> SET PASSWORD = PASSWORD (' 123.com '); Mysql> Exitbye [[email protected] tools]# mysql-uroot-p123.com warning:using a password on the command line int Erface 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) #, Oracle and/o R its affiliates. All rights reserved. Oracle is a registered trademark of the Oracle Corporation and/or its affiliates. Other names trademarks of their respective owners. Type ' help ', ' or ' \h ' for help. Type ' \c ' To clear the current input statement. Mysql>
8. Set up the MySQL service to boot from.
[[email protected] tools]# chkconfig mysql on [[email protected] tools]# chkconfig mysql--list mysql 0:off 1:off< C2/>2:on 3:on 4:on 5:on 6:off
To this end, install the MySQL5.6 version of the database with RPM installation complete, thank you.
CentOS6.5 System RPM Package installation MySQL5.6