1. Install MySQL base and dependent software
Yum Install Ncurses-devel libaio-devel-ycd/usr/local/srcwget http://www.cmake.org/files/v3.2/cmake-3.2.3.tar.gz-- NO-CHECK-CERTIFICATETAR-ZXVF cmake-3.2.3.tar.gzcd cmake-3.2.3./configuregmakegmake install# Add system users and directories Useradd-r Mysql-s/sbin/nologinmkdir/data/mysql/data-p
2. Download and install MySQL
Cd/usr/local/srcwget FTP://FTP.JAIST.AC.JP/PUB/MYSQL/DOWNLOADS/MYSQL-5.6/MYSQL-5.6.32.TAR.GZTAR-ZXVF MYSQL-5.6.32.TAR.GZCD Mysql-5.6.32cmake. -dcmake_install_prefix=/usr/local/mysql-5.6.32-dmysql_datadir=/data/mysql/data-dmysql_unix_addr=/data/mysql/ Data/mysql.sock-dsysconfdir=/etc-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dextra_charsets=all- Denabled_local_infile=1-dwith_innobase_storage_engine=1-dwith_federated_storage_engine=1-dwith_blackhole_ Storage_engine=1-dwithout_example_storage_engine=1-denable_downloads=1-dwith_zlib=bundled-dwith_readline=1- Dwith_embedded_server=1-dwith_debug=0make && make Install
3. Initialization and configuration files
Ln-s/usr/local/mysql-5.6.32//usr/local/mysql# Initializing database/usr/local/mysql/scripts/mysql_install_db --basedir=/ Usr/local/mysql--datadir=/data/mysql/data/--user=mysql\cp/usr/local/mysql/support-files/my-default.cnf/etc/ MY.CNF Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqldchown-r mysql.mysql/data/mysql/data/# Configure the environment variable echo ' path= '/usr/local/mysql/bin: $PATH "' >>/etc/profilesource/etc/profile# set the MySQL user password/usr/local/ mysql/bin/mysqladmin-u root password ' 123 '
4. Start data
[[email protected] mysql-5.6.32]#/etc/init.d/mysqld startstarting MySQL. success! [Email protected] mysql-5.6.32]# mysqlwelcome to the MySQL monitor.
MySQL-5.6.32 Installation Deployment