To be a better coder
分类: LINUX
2020-12-09 17:52:57
下载的源码包 mysql-8.0.16.tar.gz
编译安装mysql-8.0.16 遇到的问题和解决方案:
一:CMake 3.4.3 or higher is required. You are running version 2.8.12.2
要求安装cmake3这个包
需要安装扩展包,cmake3 在扩展库里面
yum install epel-release -y
yum install cmake3 -y
二:Please do not build in-source. Out-of source builds are highly
1.在mysql源码根目录下新建build:mkdir -p build
2.切换build目录:cd build/
3.将cmake3. 换成 cmake3.. 执行编译命令即可,不再报错
三:GCC 5.3 or newer is required (-dumpversion says 4.8.5)
升级GCC 要求 >5.3
cd gcc-9.1.0 ./contrib/download_prerequisites 如果不成功可以手动下载依赖 yum install gmp-devel // 編譯依賴此庫 yum install mpfr-devel // 編譯依賴此庫 yum install libmpc-devel // 編譯依賴此庫 当然以上库可以在ftp://gcc.gnu.org/pub/gcc/infrastructure/下载 isl 选择安装(我执行./contrib/download_prerequisites成功,没有安装这个文件) 下载isl-0.18.tar.bz2 // yum 没有这个库源码安装 wget ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2 tar -jxvf isl-0.18.tar.bz2 cd isl-0.18 ./configure make make install
mkdir gcc-build-9
cd gcc-build-9
# ln -s /usr/local/gcc/bin/gcc /usr/bin/gcc
# ln -s /usr/local/gcc/bin/c++ /usr/bin/c++
# ln -s /usr/local/gcc/bin/g++ /usr/bin/g++
# ln -s /usr/local/gcc/lib64/libstdc++.so.6.0.22 /usr/lib64/libstdc++.so.6
在my.cnf里面设置
log-bin-trust-function-creators=1
mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 3678 (HY000) at line 1: Schema directory './zabbix' already exists. This must be resolved manually (e.g. by moving the schema directory to another location).
[root@localhost mysql]# rm -rf zabbix/
select @@GLOBAL.sql_mode
找到安装目录下的my.cnf(windows系统则是my.ini)文件
在sql_mode中加入STRICT_TRANS_TABLES则表示开启严格模式,如没有加入则表示非严格模式,修改后重启mysql即可
例如这就表示开启了严格模式:
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES