TOP

CentOS 7.6 下MySQL 8.0.16编译安装(一)
2019-07-10 20:11:34 】 浏览:176
Tags:CentOS 7.6 MySQL 8.0.16 编译 安装

2.安装基础包 


yum -y install ntpdate gcc gcc-c++ ncurses ncurses-devel cmake readline-devel zlib.x86_64 zlib-devel.x86_64 bison libcurl-* net-tool* tree nmap sysstat lrzsz dos2unix telnet.x86_64 nethogs iftop iotop unzip ftp.x86_


64 xfs* expect vim wget psmisc openssh-client* libaio libaio1 libnuma openssl-devel bzip2


3.基础环境配置


systemctl stop firewalld


systemctl disabled firewalld


systemctl stop postfix


systemctl disable postfix


sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config && cat /etc/selinux/config >> ${tmplog_dir}/base.log 2>&1


setenforce 0


getenforce



4.内核参数修改


echo "vm.swappiness=10">>/etc/sysctl.conf


echo "net.ipv4.tcp_tw_recycle=1">>/etc/sysctl.conf


echo "net.ipv4.tcp_tw_reuse=1">>/etc/sysctl.conf


echo "vm.dirty_background_ratio=8">>/etc/sysctl.conf


echo "* soft nofile 1024000" >>/etc/security/limits.conf


echo "* hard nofile 1024000" >>/etc/security/limits.conf


数据盘挂挂载参数
rw,noatime,nodiratime,nobarrier


5.升级gcc


mkdir /usr/local/tools && cd /usr/local/tools


wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-5.5.0/gcc-5.5.0.tar.xz


tar xf gcc-5.5.0.tar.xz


cd gcc-5.5.0


./contrib/download_prerequisites


mkdir build && cd build


../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib


make && make install



6.升级cmake



建议另外开一个session防止环境变量未生效


cd /usr/local/tools


wget https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5.tar.Z


./bootstrap


make && make install


如果出现以下错误
ibstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./destructor)
处理如下:


find / -name "libstdc++.so*"


mv /usr/lib64/libstdc++.so.6.0.21 /tmp/


cp /usr/local/tools/gcc-5.5.0/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.21 /usr/lib64/


mv /usr/lib64/libstdc++.so.6 /tmp/


ln -s libstdc++.so.6.0.21 libstdc++.so.6



7.编译安装Mysql


cd /usr/local/tools


tar xf  mysql-boost-8.0.16.tar.gz


cd mysql-8.0.16


cmake . \


-DWITH_BOOST=/usr/local/tools/mysql-8.0.16/boost/boost_1_69_0 \


-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \


-DMYSQL_DATADIR=/data/mysql3306/data \


-DWITHOUT_CSV_STORAGE_ENGINE=1 \


-DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \


-DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \


-DFORCE_INSOURCE_BUILD=1 \


-DWITH_SSL=system \


-DCMAKE_CXX_COMPILER=/usr/local/bin/g++ \


-DCMAKE_C_COMPILER=/usr/local/bin/gcc


make -j 8


make install



8.生成配置文件


cat /data/conf/my3306.cnf


[client]


port    = 3306


socket  = /data/mysql3306/data/mysql.sock


[mysql]


prompt="\u@netdatdb01-137-32 \R:\m:\s [\d]> "


no-auto-rehash


[mysqld]


user    = mysql


port    = 3306


basedir = /usr/local/mysql


datadir = /data/mysql3306/data


tmpdir = /data/mysql3306/tmp


socket  = /data/mysql3306/data/mysql.sock


pid-file = netdatdb01-137-32.pid


character-set-server = utf8mb4


skip_name_resolve = 1


#若你的MySQL数据库主要运行在境外,请务必根据实际情况调整本参数


default_time_zone = "+8:00"


open_files_limit    = 65535


back_log = 1024


max_connections = 512


max_connect_errors = 1000000


table_open_cache = 1024


table_definition_cache = 1024


table_open_cache_instances = 64


thread_stack = 512K


external-locking = FALSE


max_allowed_packet = 32M


sort_b
CentOS 7.6 下MySQL 8.0.16编译安装(一) https://www.cppentry.com/bencandy.php?fid=57&id=227500

首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇深入理解MySQL数据库InnoDB存储引.. 下一篇MySQL 5.5版本搭建实例的部分库的..