1. Download the source package
#wget? https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.17.tar.gz
2. Go to unzip directory
CD mysql-5.7.17
3. Installation related dependencies
[email protected] mysql-5.7.17]# Yum install-y cmake gcc-c++* make Ncurses-devel
2, 4, create MySQL running user
[[email protected] mysql-5.7.18]# useradd-m-s/sbin/nologin MySQL
5. Execute source code compilation
#cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_unix_addr=/tmp/mysql.sock-ddefault_charset=utf8-ddefault_ Collation=utf8_general_ci-dwith_extra_charsets=all-dwith_myisam_storage_engine=1-dwith_innobase_storage_engine =1-dwith_memory_storage_engine=1-dwith_readline=1-denabled_local_infile=1-dmysql_datadir=/usr/local/mysql/data -dmysql-user=mysql-ddownload_boost=1-dwith_boost=./boost
3, after compiling, the following is installed, execute the following command
#make-j 4 && make install
At compile time, if the virtual machine or machine configuration too low will report the following error, it is recommended to configure the 4-core 4G configuration to install, my installation is card to 75% here, and then no move
cc1plus:warning:unrecognized command line option "-wno-unused-local-typedefs"
After you have finished adjusting the configuration, perform the installation command above
#make-j 4 && make install
7. Change folder owner and owner Group
Chown-r mysql.mysql/usr/local/mysql/
8. Manually add the Edit configuration file
[Email protected] mysql-5.7.18]# cd/usr/local/mysql/support-files/
[Email protected] support-files]# vim my-default.cnf
[Mysqld]
Sql_mode=no_engine_substitution,strict_trans_tables
Basedir =/usr/local/mysql
DataDir =/usr/local/mysql/data
Port = 3306
Socket =/tmp/mysql.sock
Character-set-server=utf8
Back_log = 300
Max_connections = 3000
Max_connect_errors = 50
Table_open_cache = 4096
Max_allowed_packet = 32M
#binlog_cache_size = 4M
Max_heap_table_size = 128M
Read_rnd_buffer_size = 16M
Sort_buffer_size = 16M
Join_buffer_size = 16M
Thread_cache_size = 16
Query_cache_size = 128M
Query_cache_limit = 4M
Ft_min_word_len = 8
Thread_stack = 512K
Transaction_isolation = Repeatable-read
Tmp_table_size = 128M
#log-bin=mysql-bin
Long_query_time = 6
Server_id=1
Innodb_buffer_pool_size = 1G
Innodb_thread_concurrency = 16
Innodb_log_buffer_size = 16M
Innodb_log_file_size = 512M
Innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
Innodb_lock_wait_timeout = 120
Innodb_file_per_table = On
[Mysqldump]
Quick
Max_allowed_packet = 32M
[MySQL]
No-auto-rehash
Default-character-set=utf8
Safe-updates
[Myisamchk]
Key_buffer = 16M
Sort_buffer_size = 16M
Read_buffer = 8M
Write_buffer = 8M
[Mysqlhotcopy]
Interactive-timeout
[Mysqld_safe]
Open-files-limit = 8192
[Client]
9. Initialize MySQL Service
Bin/mysqld--initialize-insecure--user=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data/
10. Copying configuration files
Cp/usr/local/mysql/support-files/my-default.cnf/etc/my.cnf
11. Copy Startup script
Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
12, modify the startup script, in the following location, write the installation path
Vim/etc/init.d/mysqld
Basedir=/usr/local/mysql
Datadir=/usr/local/mysql/data
13. Start the MySQL service
Cd/usr/local/mysql/bin/./mysqld_safe--user=mysql &service mysqld Restart
Shutting down MySQL. Success!?
Starting MySQL. Success!?
14 make the soft connection, let the system call directly
Ln-s/usr/local/mysql/bin/*/bin/
15, the login database reported the following error, card here
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/tmp/mysql.sock ' (2)
The system did not find the Mysql.sock file
Here the configuration file is written in Mysqld.sock?? Change the mysqld.sock in the config file to mysql.sock Restart the MySQL service, you can log in
Default no password directly logged in
Mysql
Welcome to the MySQL monitor.? Commands End With; or \g.
Your MySQL Connection ID is 3
Server version:5.7.18 Source Distribution
Copyright (c), 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>
16. Login Database Change Password
mysql> SET PASSWORD = PASSWORD (' xinwangai7/');
Query OK, 0 rows affected, 1 Warning (0.00 sec)
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
Test log in with a new password
Mysql-u root-p
Enter Password:?
Welcome to the MySQL monitor.? Commands End With; or \g.
Your MySQL Connection ID is 5
Server version:5.7.18 Source Distribution
Copyright (c), 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>?
mysql-boost-5.7.17 Installation