ppc64le服务器编译安装MySQL8.0源码

  1. 安装依赖
    yum -y install zlib-devel bzip2-devel numactl-devel \
    openssl-devel lz4-devel libxml2-devel wget readline-devel \
    libevent libevent-devel jemalloc-devel libaio-devel git bison cmake cmake3 \
    libtirpc libtirpc-devel numad libzstd libzstd-devel libedit-devel libicu libicu-devel \
    protobuf protobuf-devel
  2. 安装devtoolset-9
    yum install devtoolset-9
  3. 下载mysql源码并解压   下载MySQL8.0 boost版本源码
    wget https://downloads.mysql.com/archives/get/p/23/file/mysql-boost-8.0.26.tar.gz
    tar zxvf mysql-boost-8.0.26.tar.gz 
    cd mysql-8.0.26
    mkdir build&&cd build
    sed -i 's/ut0new/#ut0new/g' ../unittest/gunit/innodb/CMakeLists.txt
  4. 编译
    cmake -LHA .. \
      -DWITH_BOOST=/home/data/debug/mysql-8.0.11/boost \
      -DBUILD_CONFIG=mysql_release \
      -DCMAKE_BUILD_TYPE=RelWithDebInfo \
      -DCMAKE_C_COMPILER=`which gcc` \
      -DCMAKE_C_FLAGS="-O3 -mcpu=native -mtune=native -mcmodel=large" \
      -DCMAKE_CXX_COMPILER=`which g++` \
      -DCMAKE_CXX_FLAGS="-O3 -mcpu=native -mtune=native -mcmodel=large" \
      -DCMAKE_INSTALL_PREFIX=/opt/mysql/8.0.26 \
      -DCMAKE_LINKER=`which gcc` \
      -DCMAKE_AR=`which gcc-ar` \
      -DCMAKE_NM=`which gcc-nm` \
      -DCMAKE_RANLIB=`which gcc-ranlib` \
      -DWITH_INNODB_MEMCACHED=1 \
      -DWITH_SSL=system \
      -DWITH_ZLIB=bundled \
      -DWITH_JEMALLOC=ON \
      -DUSE_LD_LLD=0 \
      -DWITH_NDBCLUSTER=1 \
      -DWITH_SYSTEMD=1 \
      -DWITH_NUMA=ON 2>&1 | tee config.log
  5. 编译
    make -j32 VERBOSE=1 2>&1 | tee build.log
  6. 安装
    sed -i '85,$d' man/cmake_install.cmake
    make install
  7. 初始化
    cd /opt/mysql/8.0.26/bin
    ./mysqld --initialize-insecure
  8. 启动
    ./mysqld

  9.  测试连接MySQL

    ./mysqql

     至此  编译安装成功

问题  1.

You can try downloading  http://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz

到官网下载boost,存放路径为-DWITH_BOOST设置的路劲地址

安装boost

cd boost_1_66 &&./bootstrap.sh

.b2 install

如果需要升级boot  只需要删除相关文件,重新下载更高版本安装

rm -rf /usr/local/include && rm -rf /usr/local/lib/libboot*

 

问题2 安装 jemalloc-devel

下载jemalloc-devel   地址 https://cbs.centos.org/kojifiles/packages/jemalloc/3.6.0/1.el7/ppc64le/

安装 

yum localinstall *.rpm

 问题3  Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

/tmp/mysql.sock路径与my.cnf配置不一样 

 解决办法  设置软连接

find / -name mysql.sock

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

 

posted @ 2023-06-07 16:30  转身瞬间  阅读(69)  评论(0编辑  收藏  举报