基本上按照文档
https://www.huaweicloud.com/kunpeng/software/mysql0.html
文档中的cmake脚本启动报错,把换行全去掉了
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/data -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DENABLE_DTRACE=0 -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DWITH_EMBEDDED_SERVER=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/mysql/mysql-5.7.31/boost/boost_1_73_0
./cmake.sh时报错Please install the appropriate openssl developer package.
CMake Error at rapid/plugin/group_replication/rpcgen.cmake:100 (MESSAGE):
yum install ncurses-devel
yum install openssl-devel
yum install rpcgen
make时遇到报错Package ‘libtirpc’, required by ‘virtual:world’, not found
直接yum安装解决
yum install -y libtirpc-devel
make时遇到报错CMake Error at rapid/plugin/group_replication/rpcgen.cmake:100 (MESSAGE):
Could not find rpcgen
下载依赖编译安装
wget https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz
tar xf rpcsvc-proto-1.4.tar.gz
cd rpcsvc-proto-1.4
./configure
make
make install
make install时报错error:‘prctl’ was not declared in this scope
cp /usr/include/sys/prctl.h /mysql源码目录/include/
vim mysql-5.7.27/sql/mysqld.cc添加一行#include “prctl.h”
/etc目录下没有my.cnf,直接自己创建
[mysqld]
datadir=/data/data
socket=/data/data/mysql.sock
symbolic-links=0
[mysqld_safe]
log-error=/data/log/mysql.log
pid-file=/data/run/mysql.pid