靠记忆了
下载的包是mysql-8.0.20 带boost
安装环境是centos7.6
解压缩后进入mysql-8.0.20
mkdir build-mysql
sudo cmake3 .. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_unicode_ci -DENABLED_LOCAL_INFILE=ON -DWITH_SSL=system -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/server -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_TCP_PORT=3306 -DDOWNLOAD_BOOST=0 -DWITH_BOOST=/root/softwares/mysql-8.0.20/boost/ -DCMAKE_CXX_COMPILER=/usr/local/gcc/bin/g++
遇到别的问题
/root/mysql-8.0.20/storage/innobase/trx/trx0trx.cc: In function ‘void trx_init(trx_t*)’:
/root/mysql-8.0.20/storage/innobase/trx/trx0trx.cc:222:5: error: ‘os_compare_and_swap_thread_id’ was not declared in this scope; did you mean ‘os_compare_and_swap_lint’?
222 | os_compare_and_swap_thread_id(&trx->killed_by, thread_id, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| os_compare_and_swap_lint
/root/mysql-8.0.20/storage/innobase/trx/trx0trx.cc: In function ‘void trx_kill_blocking(trx_t*)’:
/root/mysql-8.0.20/storage/innobase/trx/trx0trx.cc:3230:5: error: ‘os_compare_and_swap_thread_id’ was not declared in this scope; did you mean ‘os_compare_and_swap_lint’?
3230 | os_compare_and_swap_thread_id(&victim_trx->killed_by, thread_id, 0);
修改storage/innobase/trx/trx0trx.cc中替换os_compare_and_swap_thread_id为os_compare_and_swap_lint,注意有两处修改 分别在 222 和3230 行左右附近啦
make
make install