centos 6.6 compile and install mysql 5.6

1. Download Source
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.25.tar.gztar xzvf mysql-5.6.25.tar.gz
2. Preparing for Installation
# Adding user groups groupadd www # Add a user useradd -c mysql-user -g www -M mysql # installation depends yum install libaio-devel # Create a data directory mkdir / data / soft / mysqlchown -R mysql: www / data / soft / mysql
3. Install from mysql5.5 onwards, mysql start using cmake a source installation, set source compiler configuration script.
cmake -DCMAKE_INSTALL_PREFIX = / usr / local / mysql -DMYSQL_UNIX_ADDR = / usr / local / mysql / mysql.sock -DDEFAULT_CHARSET = utf8 -DDEFAULT_COLLATION = utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE = 1 -DWITH_ARCHIVE_STORAGE_ENGINE = 1 -DWITH_BLACKHOLE_STORAGE_ENGINE = 1 -DMYSQL_DATADIR = / data / mysqldb -DMYSQL_TCP_PORT = 3306 -DENABLE_DOWNLOADS = 1
NOTE: Rerun configuration files need to be deleted CMakeCache.txt
rm CMakeCache.txt
# Compile make # install make install
4.mysql home directory and data directory processing
chown -R mysql: www / usr / local / mysqlchown -R mysql: www / data / soft / mysql
5. Initialize the database
chmod + x / usr / local / mysql / scripts / mysql_install_db / usr / local / mysql / scripts / mysql_install_db –user = mysql –datadir = / data / soft / mysql
6. Copy the configuration file
cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf modify some configuration # These are commonly set, remove the # and set as required.basedir = / usr / local / mysql # datadir = ….. datadir = / data / soft / mysql # port = ….. # server_id = ….. socket = /usr/local/mysql/mysql.sock
7. Copy Service Script
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqldchmod + x /etc/init.d/mysqld
8. Add the boot items
/etc/init.d/mysqld startchkconfig –level 35 mysqld on
9. Run the security setup script, modify MySQL root user password, and can prohibit root remote connections, remove the test databases and anonymous user.
/ Usr / local / mysql / scripts / mysql_install_db –basedir = / usr / local / mysql –datadir = / data / soft / mysql –user = mysql