1. Download the source code
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.23.tar.gz
2. Unzip
3. Install the necessary packages
sudo yum install cmake gcc-c++ ncurses-devel perl-data-dumper
4. Enter the MySQL source directory to generate makefile
CMake.
5. Compiling
Make
6. Installation
Make install
MySQL will be installed to the/usr/local/mysql path, so the pre-installation files are not stored in this directory.
7. Adding MySQL Users and Groups
sudo groupadd MySQL
8. Modify directory and file permissions to install the default database
Cd/usr/local/mysql chown-r MySQL.
Chgrp-r MySQL.
Chown-r Root.
Chown-r MySQL Data
Don't forget to command the last dot
At this point, MySQL can start running.
9. Start MySQL
Cd/etc
And so on/etc to rebuild the My.cnf file, the contents are as follows
# for advice The change settings "See # Http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults. HTML [mysqld] # Remove Leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of all RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove Leading # to turn on a very important data integrity Option:logging # Chang ES to the binary log between backups. # Log_bin # These is commonly set, remove the # and set as required. # basedir = ... # datadir =/data/mysql/data # port = ... # server_id = ..... # socket = ..... # Remove Leading # to set options mainly useful for reporting servers. # The server defaults is faster for transactions and fast selects. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M Max_connection = 10000 Sql_mode = NO_ engine_substitution,strict_trans_tABLES #binary Log log-bin = Mysql-bin Binlog_format = Mixed Expire_logs_day = #slow query log slow_query_l og = 1 slow_query_log_file =/var/log/mysql/slow.log long_query_time = 3 log-queries-not-using-indexes log-slow-admin- Statements
Now it's time to start MySQL.
/usr/local/mysql/bin/mysqld_safe--user=mysql &
CentOS7 cannot use service to control MySQL services, and source-installed MySQL does not provide systemd control scripts.
Then edit the/etc/rc.d/rc.local file and add the MySQL boot command.
/usr/local/mysql/bin/mysqld_safe--user=mysql &
Then add executable permissions to/etc/rc.d/rc.local
9. Change the root password
/usr/loca/mysql/bin/mysql-uroot use mysql; UPDATE user SET Password = password (' test2015 ') WHERE user = ' root ';
GRANT all privileges on * * to [email protected] '% ' identified by ' passwd2015 ';
FLUSH privileges;
At this point, the installation is basically complete, a MySQL can be used.
Compiling and installing MySQL 5.6.23 on CentOS 7