暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
MySQL8.1源码安装与部署.pdf
166
11页
1次
2023-07-27
10墨值下载
官方文档
下载源码
源码安装先决条件
https://dev.mysql.com/doc/refman/8.1/en/source-installation.html
官方文档源码安装步骤
# Preconfiguration setup
$> groupadd mysql
$> useradd -r -g mysql -s /bin/false mysql
# Beginning of source-build specific instructions
$> tar zxvf mysql-VERSION.tar.gz
$> cd mysql-VERSION
$> mkdir bld
$> cd bld
$> cmake ..
$> make
$> make install
# End of source-build specific instructions
# Postinstallation setup
$> cd /usr/local/mysql
$> mkdir mysql-files
$> chown mysql:mysql mysql-files
$> chmod 750 mysql-files
$> bin/mysqld --initialize --user=mysql
$> bin/mysql_ssl_rsa_setup
$> bin/mysqld_safe --user=mysql &
# Next command is optional
$> cp support-files/mysql.server /etc/init.d/mysql.server
https://dev.mysql.com/get/Downloads/MySQL-8.1/mysql-8.1.0.tar.gz
[root@node01 ~]# wget https://dev.mysql.com/get/Downloads/MySQL-8.1/mysql-
8.1.0.tar.gz
1gcccmake版本要求
LinuxGCC 7.1 Clang 5
CMake3.75
2、依赖包
cmakemakeautomakeautoconfgccgcc-c++ncurses-developenssl-devel
libmcrypt
3、安装依赖包
[root@node01 ~]# yum install cmake make gcc gcc-c++ autoconf automake openssl
openssl-devel ncurses-devel libmcrypt* -y
升级gcc
升级cmake
4、卸载mariadb
[root@node01 ~]# yum remove mariadb -y
5、删除配置文件
[root@node01 ~]# rm -rf /etc/my.cnf
1、操作系统版本
[root@node01 ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
2、查看gcc版本
[root@node01 ~]# gcc -v
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
3、安装scl
[root@node01 ~]# yum install centos-release-scl -y
[root@node01 ~]# yum list |grep gcc
4、安装gcc8
[root@node01 ~]# yum install -y devtoolset-8-gcc*
5、临时切换gcc
[root@node01 ~]# source /opt/rh/devtoolset-8/enable
6、查看gcc版本
[root@node01 ~]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-
linux/8/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-
languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-8/root/usr --
mandir=/opt/rh/devtoolset-8/root/usr/share/man --infodir=/opt/rh/devtoolset-
8/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --
enable-shared --enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --
enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only
--with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --
enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-
8.3.1-20190311/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-
gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-
redhat-linux
Thread model: posix
gcc version 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)
1cmake编译
创建用户组和用户
[root@node01 bld]# cmake ..
-- Running cmake version 2.8.12.2
CMake Warning at CMakeLists.txt:82 (MESSAGE):
Please use cmake3 rather than cmake on this platform
-- Please install cmake3 (yum install cmake3)
CMake Error at CMakeLists.txt:112 (CMAKE_MINIMUM_REQUIRED):
CMake 3.5.1 or higher is required. You are running version 2.8.12.2
2、升级cmake,先移除原cmake
[root@node01 ~]# yum remove cmake -y
3、下载cmake源码
[root@node01 ~]# wget
https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5.tar.gz
4、解压缩
[root@node01 ~]# tar -zxf cmake-3.14.5.tar.gz
5、编译安装
[root@node01 ~]# cd cmake-3.14.5
[root@node01 cmake-3.14.5]# ./bootstrap
[root@node01 cmake-3.14.5]# gmake
[root@node01 cmake-3.14.5]# gmake install
5、查看升级后版本
[root@node01 cmake-3.14.5]# /usr/local/bin/cmake --version
cmake version 3.14.5
CMake suite maintained and supported by Kitware (kitware.com/cmake).
6、建立软链接
[root@node01 cmake-3.14.5]# ln -s /usr/local/bin/cmake /usr/bin/
[root@node01 ~]# cmake -version
cmake version 3.14.5
CMake suite maintained and supported by Kitware (kitware.com/cmake).
至此,cmake升级完毕
1、查看用户mysql是否存在
[root@node01 ~]# id mysql
id: mysql: no such user
2、创建用户组
[root@node01 ~]# groupadd -g 54321 mysql
3、创建用户
[root@node01 ~]# useradd -r -g mysql -s /bin/false -u 54321 mysql
4、查看用户
of 11
10墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。