Download mysql-community-5.7.18-1.el6.src.rpm
# RPM-IVH mysql-community-5.7.18-1.el6.src.rpm
The Rpmbuild folder will be installed in the sibling directory
Go to sources directory, unzip mysql-5.7.18.tar.gz
# CD mysql-5.7.18
# mkdir Debug && CD Debug
# CMake. \
-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/usr/local/mysql/data \
-dwith_boost=/root/rpmbuild/sources \
-DSYSCONFDIR=/ETC \
-DEFAULT_CHARSET=UTF8MB4 \
-DDEFAULT_COLLATION=UTF8MB4_GENERAL_CI \
-denabled_local_infile=1 \
-dextra_charsets=all \
-dwith_debug=on \
-denabled_local_infile=on \
-dwith_innodb_memcached=on
# Make && make install
# Cat MY.CNF
# Generated by Percona Configuration Wizard (http://tools.percona.com/) version rel5-20120208
# Configuration name server-176 generated for [e-mail protected] at 2017-08-19 13:42:35
[MySQL]
# CLIENT #
Port = 3306
Socket =/usr/local/mysql/data/mysql.sock
[Mysqld]
# General #
user = MySQL
#default-storage-engine = InnoDB
Character_set_server = UTF8
Socket =/usr/local/mysql/data/mysql.sock
Pid-file =/usr/local/mysql/data/mysql.pid
# MyISAM #
Key-buffer-size = 32M
#myisam-recover = Force,backup
# SAFETY #
Max-allowed-packet = 16M
Max-connect-errors = 1000000
Skip-name-resolve
Sql-mode = Strict_trans_tables,error_for_division_by_zero,no_auto_create_user,no_auto_value_on_zero,no_engine_ Substitution,no_zero_date,no_zero_in_date,only_full_group_by
Sysdate-is-now = 1
InnoDB = Force
# DATA STORAGE #
DataDir =/usr/local/mysql/data/
# BINARY LOGGING #
Log-bin =/usr/local/mysql/data/mysql-bin
Expire-logs-days = 14
Sync-binlog = 1
Server-id = 1
# CACHES and LIMITS #
Tmp-table-size = 32M
Max-heap-table-size = 32M
Query-cache-type = 0
Query-cache-size = 0
Max-connections = 500
Thread-cache-size = 50
Open-files-limit = 65535
Table-definition-cache = 1024
Table-open-cache = 2048
# INNODB #
Innodb_data_file_path = Ibdata1:1024m:autoextend
Innodb-flush-method = O_direct
Innodb-log-files-in-group = 2
Innodb-log-file-size = 128M
Innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
Innodb-buffer-pool-size = 512M
# LOGGING #
Log-error =/usr/local/mysql/data/mysql-error.log
Log-queries-not-using-indexes = 1
Slow-query-log = 1
Slow-query-log-file =/usr/local/mysql/data/mysql-slow.log
#./bin/mysqld--initialize--basedir=/usr/local/mysql/--user=mysql--datadir=/usr/local/mysql/data/
Modify root password alter user [email protected] identified by ' 123456 '
# mysqld--debug--console &
Perform related operations select and so on
View/tmp/mysqld.trace
| <mysql_ha_cleanup 1083
[email protected]: | >mdl_context::release_transactional_locks
[email protected]: | | >mdl_context::release_locks_stored_before
[email protected]: | | <mdl_context::release_locks_stored_before 4411
[email protected]: | | >mdl_context::release_locks_stored_before
[email protected]: | | <mdl_context::release_locks_stored_before 4411
[email protected]: | <mdl_context::release_transactional_locks 4690
[email protected]: | >mysql_ull_cleanup
centos6.5 Compile Debug mysql-5.7.18