3 Ways to install MySQL
# yum Install MySQL Mysql-server
# RPM-IVH mysql-client-5.6.23-1.linux_glibc2.5.i386.rpm mysql-server-5.6.23-1.linux_glibc2.5.i386.rpm
Install by binary file (couldneed to install CMake gcc gcc-c++ ncursesfirst):
A. # tar xvf mysql-5.6.23.tar.gz-c/usr/src
B. # cd/usr/src/mysql-5.6.23
C. # CMake. -dcmake_install_prefix=/usr/local/mysql/-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-denabled_ Local_infile=on
D. # make J2
E. # make Install
Note:options of CMake refer to official docs
After installation, set up the configuration files (if with default configuration, jump to start MySQL and set up p Assword).
# VIM/ETC/MY.CNF
[Mysqld]
Datadir=/data
User=mysql
Socket=/data/mysqld.sock
Skip-name-resolve
port=3306
Log-bin=/data/mysqld-bin
Log-bin-index=/data/mysql-bin
Server-id=1
[Mysqld_safe]
Log-error=/data/mysqld.err
Pid-file=/data/mysqld.pid
Make directory and initiate
# Rm-rf/data
# Mkdir/data
# Cd/usr/local/mysql
#./scripts/mysql_install_db--datadir=/data--user=mysql
Start MySQL and set up password
# Mysqld_safe--DEFAULTS-FILE=/ETC/MY.CNF &
Or
# CP./support-files/mysql.server/etc/rc.d/init.d/sql
# chmod 755/etc/rc.d/init.d/sql
# Service SQL start
# mysqladmin-u root-s/data/mysqld.sock password ' 123 '
# mysqladmin-u root-h 127.0.0.1-p 3306 password ' 123 '
or
# ln-s/data/mysqld.sock/tmp/mysql.sock
# mysql_secure_installation
# Rm-rf/tmp/mysql.sock
Login MySQL
# mysql-u Root-s/data/mysqld.sock
Or
# mysql-u Root-h 127.0.0.1-p3306
Install MySQL on RHEL 32bit