当前位置:   article > 正文

Ubuntu MySQL 8.0.32调试环境搭建_mysql-boost-8.0.32.tar.gz 下载

mysql-boost-8.0.32.tar.gz 下载

之前在centos上基于5.7 mysql部署过debug环境,由于现在转为ubuntu环境和8.0的mysql
记录在该环境下的调试环境部署过程,供参考

1.下载源码包

wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-8.0.32.tar.gz
  • 1

2.依赖软件部署

apt install cmake
apt install -y gcc 
apt install -y ncurses-devel perl-Data-Dumper git
apt install -y boost-devel 
apt install -y boost
apt-get install autoconf automake libtool make g++ unzip

wget http://www.zlib.net/zlib-1.2.13.tar.gz


cd zlib-1.2.11
./configure --prefix=/fdfs/soft/zlib && make  && make install
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

3.编译安装mysql

tar -zxvf mysql-boost-8.0.32.tar.gz

mkdir /data/mysql0307/
mkdir /data/mysql0307/data
cd /data/mysql0307/

cd /data/tools/mysql-8.0.32/build

cmake .. -DCMAKE_INSTALL_PREFIX=/data/mysql0307/ \ 
-DMYSQL_DATADIR=/data/mysql0307/data/ \ 
-DSYSCONFDIR=/data/mysql0307/ -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ 
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ 
-DWITH_FEDERATED_STORAGE_ENGINE=1 \ 
-DWITH_PARTITION_STORAGE_ENGINE=1  \ 
-DMYSQL_UNIX_ADDR=/data/mysql0307/mysql.sock \ 
-DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all \ 
-DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci \ 
-DMYSQL_USER=mysql  -DWITH_BINLOG_PREALLOC=ON  \
-DWITH_BOOST=/data/tools/mysql-8.0.32/boost/boost_1_77_0 -DWITH_DEBUG=1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
make -j4
make install
groupadd mysql
useradd -g mysql mysql
chown -R mysql:mysql /data/mysql0307/
cd /data/mysql0307/
./mysqld --initialize --defaults-file=/etc/my.cnf \
 --datadir=/data/mysql0307/data/ --basedir=/data/mysql0307/ --user=mysql
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
cat /etc/mysql/my.cnf
[mysqld]
datadir=/data/mysql0307/data
socket=/data/mysql0307/mysql.sock
user=mysql
port=3306
authentication_policy=mysql_native_password
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

tmpdir=/data/tmp01:/data/tmp02:/data/tmp03
#slave_load_tmpdir=/data1/tmp01
innodb_log_group_home_dir=/data/mysql0307/data
innodb_data_home_dir=/data/mysql0307/data
skip_name_resolve
secure_file_priv=""
log_timestamps=SYSTEM

#innodb
innodb_data_file_path=ibdata1:2G;ibdata2:2G;ibdata3:2G;ibdata4:2G;ibdata5:16M:autoextend
innodb_buffer_pool_size = 50G
innodb_buffer_pool_instances = 8
innodb_log_files_in_group = 2
innodb_log_file_size = 2G
innodb_log_buffer_size=500M
innodb_flush_log_at_trx_commit=2
innodb_thread_concurrency=0
innodb_thread_sleep_delay=10000
innodb_read_io_threads=48
innodb_write_io_threads=48
innodb_commit_concurrency=48
innodb_open_files=60000
#innodb_file_format=Barracuda
innodb_file_per_table=1
innodb_flush_method=O_DIRECT
innodb_stats_on_metadata=0
innodb_strict_mode=1
innodb_io_capacity_max=200000
innodb_io_capacity=100000
innodb_flush_neighbors=0

innodb_buffer_pool_dump_at_shutdown=ON
innodb_buffer_pool_dump_pct=75
innodb_buffer_pool_load_at_startup=ON

#myisam
key_buffer_size=64M

# undo settings
innodb_undo_log_truncate       = 1
innodb_max_undo_log_size       = 2G

#Disable Query Cache
log_error=/data/logs01/mysql-error.log
slow_query_log = on
slow_query_log_file = /data/logs01/mysql-slow.log
long_query_time = 0.1
#log_warnings = 2
#query_cache_type = 0
#query_cache_size = 0

log_bin_trust_function_creators=ON
#binlog
log_bin=/data/logs01/mysql_bin
server_id=15018  
binlog_cache_size=16M
max_binlog_cache_size=4G
max_binlog_size=500M
binlog_format=ROW
sync_binlog= 1000
log_replica_updates=1
binlog_expire_logs_seconds = 259200

#replication
relay_log=/data/logs01/relaylog
relay_log_info_file=/data/mysql0307/relay_log.info
relay_log_index=/data/logs01/mysqld_relay_bin.index
relay_log_recovery=1
relay_log_info_repository=TABLE
master_info_repository=TABLE
skip_slave_start
read_only=0
gtid_mode=ON
enforce-gtid-consistency=ON
binlog_gtid_simple_recovery = 1

# new replication settings #
replica-parallel-type          = LOGICAL_CLOCK
replica-parallel-workers       = 16
replica_preserve_commit_order  = 1
replica_transaction_retries    = 128


#server
default_storage_engine=INNODB
character_set_server=utf8mb4
lower_case_table_names=1
#skip_external_locking
open_files_limit=65536
local_infile=1
#performance_schema=0

thread_stack=512K
thread_cache_size=256
#read_rnd_buffer_size=128K
#sort_buffer_size=256K
#join_buffer_size=128K
#read_buffer_size=128K

#Thread Pool
#thread_handling=pool-of-threads
max_connections = 40000
table_open_cache = 20000
max_allowed_packet = 16M
max_connect_errors = 1000000
sql_mode=STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION

[mysql]
port=3306
prompt=\\u@\\d \\r:\\m:\\s>
#default_character_set=utf8
no_auto_rehash

[mysqld_safe]
log-error=/data/logs01/mysql-error.log
pid-file=/data/mysql0307/mysql.pid

[client]
port=3306
socket=/data/mysql0307/mysql.sock
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
cd /data/mysql0307/support-files
./mysql.server start
  • 1
  • 2

4.调试mysql

cat /data/debug.file 
break main
run --defaults-file=/etc/mysql/my.cnf --user=mysql --gdb

gdb -x /data/debug.file /data/mysql0307/bin/mysqld 

root@(none) 10:07:45>select version() ;
+--------------+
| version()    |
+--------------+
| 8.0.32-debug |
+--------------+
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

常用调试命令

* nfo threads:查看全部线程
* thread n:指定某个线程
* bt:查看某个线程栈帧
* b:设置断点
* c:继续执行
* s:执行一行代码,如果代码函数调用,则进入函数
* n:执行一行代码,函数调用不进入
* p:打印某个变量值
* list:打印代码的文本信息
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/646696
推荐阅读
相关标签
  

闽ICP备14008679号