OL7编译安装Mysql 8.0

目录

  • 安装方法
  • 安装条件
  • 安装步骤
  • 安装后测试

Mysql已经发展到8.0版本了,自行选择源码来进行编译和安装有什么好处呢?不外乎可以定制参数,采用一些优化策略,而且对一些特殊平台,我们可以在其上面定制Mysql。不过对普通用户,意义不太大,还容易造成一些性能,安全方面的问题。我们还是推荐直接使用二进制的安装包。这是官方的警告。


image.png

安装方法

安装方法有两种
第一种是使用标准分发的源代码,有多种分发格式,如下 mysql-VERSION.tar.gz, mysql-VERSION.zip, or mysql-VERSION.rpm。VERSION表示版本。
第二种是使用Mysql开发树进行安装。

安装条件

  • CMake
  • gmake
  • GCC 5.3 以上
  • Boost C++ libraries
  • The ncurses library
  • Perl

我们依次检查和准备安装条件

  1. cmake
[root@192 mysql-8.0.16]# yum install cmake
Loaded plugins: langpacks, ulninfo
local                                                    | 3.6 kB     00:00
Resolving Dependencies
--> Running transaction check
---> Package cmake.x86_64 0:2.8.12.2-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch            Version                    Repository      Size
================================================================================
Installing:
 cmake          x86_64          2.8.12.2-2.el7             local          7.0 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 7.0 M
Installed size: 27 M
Is this ok [y/d/N]:
  • cmake安装

2.gmake

[root@192 mysql-8.0.16]# yum install make
Loaded plugins: langpacks, ulninfo
Package 1:make-3.82-23.el7.x86_64 already installed and latest version
Nothing to do
[root@192 mysql-8.0.16]#
  • make检查,已经安装了

3.gcc5.5

[root@192 mysql-8.0.16]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-36.0.1) (GCC)
  • gcc检查,版本不符合要求
    我们首先要按安装好gcc
[root@192 mysql-8.0.16]# wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-5.5.0/gcc-5.5.0.tar.gz
--2019-06-25 09:57:12--  http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-5.5.0/gcc-5.5.0.tar.gz
Resolving ftp.tsukuba.wide.ad.jp (ftp.tsukuba.wide.ad.jp)... 2001:200:0:7c06::9393, 203.178.132.80
Connecting to ftp.tsukuba.wide.ad.jp (ftp.tsukuba.wide.ad.jp)|2001:200:0:7c06::9393|:80... connected.
HTTP request sent, awaiting response... 200 OK
  • 下载gcc源码
[root@192 ~]# tar zxvf gcc-5.5.0.tar.gz
[root@192 gcc-5.5.0]# ./configure --enable-checking=release
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.

配置过程提示错误。

  • 还需要额外的一些源码支持。

GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
MPFR Library version 2.4.2 (or later)
MPC Library version 0.8.1 (or later)

我们一一下载和安装

[root@192 ~]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
--2019-06-25 10:12:29--  ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
           => ‘gmp-4.3.2.tar.bz2’
Resolving gcc.gnu.org (gcc.gnu.org)... 209.132.180.131
Connecting to gcc.gnu.org (gcc.gnu.org)|209.132.180.131|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/gcc/infrastructure ... done.
==> SIZE gmp-4.3.2.tar.bz2 ... 1897483
==> PASV ... done.    ==> RETR gmp-4.3.2.tar.bz2 ... done.
Length: 1897483 (1.8M) (unauthoritative)

100%[===================================================================================================================================>] 1,897,483   1.23MB/s   in 1.5s

2019-06-25 10:12:34 (1.23 MB/s) - ‘gmp-4.3.2.tar.bz2’ saved [1897483]

[root@192 ~]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2
--2019-06-25 10:13:18--  ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2
           => ‘mpfr-3.1.4.tar.bz2’
Resolving gcc.gnu.org (gcc.gnu.org)... 209.132.180.131
Connecting to gcc.gnu.org (gcc.gnu.org)|209.132.180.131|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/gcc/infrastructure ... done.
==> SIZE mpfr-3.1.4.tar.bz2 ... 1279284
==> PASV ... done.    ==> RETR mpfr-3.1.4.tar.bz2 ... done.
Length: 1279284 (1.2M) (unauthoritative)

100%[===================================================================================================================================>] 1,279,284    867KB/s   in 1.4s

2019-06-25 10:13:23 (867 KB/s) - ‘mpfr-3.1.4.tar.bz2’ saved [1279284]

[root@192 ~]# wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz
--2019-06-25 10:14:16--  ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz
           => ‘mpc-1.0.3.tar.gz’
Resolving gcc.gnu.org (gcc.gnu.org)... 209.132.180.131
Connecting to gcc.gnu.org (gcc.gnu.org)|209.132.180.131|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/gcc/infrastructure ... done.
==> SIZE mpc-1.0.3.tar.gz ... 669925
==> PASV ... done.    ==> RETR mpc-1.0.3.tar.gz ... done.
Length: 669925 (654K) (unauthoritative)

100%[===================================================================================================================================>] 669,925      449KB/s   in 1.5s

2019-06-25 10:14:22 (449 KB/s) - ‘mpc-1.0.3.tar.gz’ saved [669925]
[root@192 ~]# bunzip2 gmp-4.3.2.tar.bz2
[root@192 ~]# bunzip2 mpfr-3.1.4.tar.bz2
[root@192 ~]# tar zxvf mpc-1.0.3.tar.gz
[root@192 ~]# tar xvf gmp-4.3.2.tar
[root@192 ~]# tar gmp-4.3.2.tar
[root@192 ~]# mv gmp-4.3.2 gcc-5.5.0/gmp
[root@192 ~]# mv mpfr-3.1.4 gcc-5.5.0/mpfr
[root@192 ~]# mv mpc-1.0.3 gcc-5.5.0/mpc

如果服务器上没有安装c++,需要补充上。

[root@192 ~]# yum install gcc-c++

准备gcc5.5的编译和安装

[root@192 ~]# cd gcc-5.5.0/
[root@192 gcc-5.5.0]# mkdir build/
[root@192 build]# cd build/
[root@192 build]# ../configure  --enable-checking=release --disable-multilib
[root@192 build]# make -j 10 

gcc非常大,编译时间有点久,泡杯茶或咖啡吧。


image.png

咖啡喝完了,我们继续。

[root@192 build]# make -j 10 
[root@192 build]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-checking=release --disable-multilib
Thread model: posix
gcc version 5.5.0 (GCC)
[root@192 build]#
[root@192 ~]# yum remove gcc
[root@192 ~]# ln /usr/local/bin/gcc /usr/bin/gcc -s
[root@192 ~]# ln /usr/local/bin/c++ /usr/bin/c++ -s
[root@192 ~]# ln /usr/local/bin/gcc /usr/bin/cc -s

貌似成功了。

  1. boost
    我们准备下载的mysql源码里就包含了。这里省略过。

5.ncurses

[root@192 build]# yum install ncurses ncurses-devel
Loaded plugins: langpacks, ulninfo
Package ncurses-5.9-14.20130511.el7_4.x86_64 already installed and latest version
Package ncurses-devel-5.9-14.20130511.el7_4.x86_64 already installed and latest version
Nothing to do
[root@192 build]#

6.perl

[root@192 build]# yum install perl
Loaded plugins: langpacks, ulninfo
Package 4:perl-5.16.3-293.el7.x86_64 already installed and latest version
Nothing to do

安装步骤

我们现在的是tar包。

[root@192 ~]# groupadd mysql
[root@192 ~]# useradd -r -g mysql -d /bin/false mysql
[root@192 ~]# tar xzvf mysql-boost-8.0.16.tar.gz
[root@192 ~]# cd mysql-8.0.16/
[root@192 mysql-8.0.16]# mkdir build
[root@192 mysql-8.0.16]# cd build
[root@192 build]# cmake ..
-- Running cmake version 2.8.12.2
CMake Warning at CMakeLists.txt:43 (MESSAGE):
  Please use cmake3 rather than cmake on this platform


-- Please install cmake3 (yum install cmake3)
CMake Error at CMakeLists.txt:55 (CMAKE_MINIMUM_REQUIRED):
  CMake 3.4.3 or higher is required.  You are running version 2.8.12.2


-- Configuring incomplete, errors occurred!
[root@192 build]#

系统自带的cmake版本还不够。还需要自己更新。

[root@192 ~]#wget https://github.com/Kitware/CMake/releases/download/v3.14.5/cmake-3.14.5.tar.gz
[root@192 ~]#tar xzvf cmake-3.14.5.tar.gz
[root@192 ~]# cd cmake-3.14.5/
[root@192 cmake-3.14.5]# ls
Auxiliary         CMakeCPackOptions.cmake.in  CMakeLogo.gif             configure         CTestConfig.cmake     doxygen.config  Modules     Source     Utilities
bootstrap         CMakeGraphVizOptions.cmake  cmake_uninstall.cmake.in  CONTRIBUTING.rst  CTestCustom.cmake.in  Help            Packaging   Templates
CMakeCPack.cmake  CMakeLists.txt              CompileFlags.cmake        Copyright.txt     DartConfig.cmake      Licenses        README.rst  Tests
[root@192 cmake-3.14.5]# ./configure

配置过程出现错误。

/root/cmake-3.14.5/Bootstrap.cmk/cmake: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /root/mysql-8.0.16/build/cmake-3.14.5/Bootstrap.cmk/cmake)

我们更新下glibc

[root@192 ~]# yum install libstdc++
[root@192 lib64]# cd /usr/lib64
[root@192 lib64]# cp /usr/local/lib64/libstdc++.so.6.0.21 /usr/lib64
[root@192 lib64]# rm libstdc++.so.6
[root@192 lib64]# ln libstdc++.so.6.0.21 libstdc++.so.6  -s
[root@192 lib64]# ll libstd*
lrwxrwxrwx. 1 root root       19 Jun 25 12:54 libstdc++.so.6 -> libstdc++.so.6.0.21
-rwxr-xr-x. 1 root root   991616 Apr 24 09:05 libstdc++.so.6.0.19
-rwxr-xr-x. 1 root root 11154008 Jun 25 12:53 libstdc++.so.6.0.21
[root@192 lib64]#

我们再试试。

[root@192 cmake-3.14.5]# ./configure
.
.
.
.
-- Looking for elf.h
-- Looking for elf.h - found
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /usr/local/bin/gfortran
-- Performing Test run_pic_test
-- Performing Test run_pic_test - Success
-- Performing Test run_inlines_hidden_test
-- Performing Test run_inlines_hidden_test - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /root/cmake-3.14.5
---------------------------------------------
CMake has bootstrapped.  Now run gmake.
[root@192 cmake-3.14.5]# gmake
[root@192 cmake-3.14.5]# gmake install
[root@192 cmake-3.14.5]# yum remove cmake
[root@192 cmake-3.14.5]# ln /usr/local/bin/cmake /usr/bin/cmake -s
[root@192 cmake-3.14.5]# cd
[root@192 ~]# cmake --version
cmake version 3.14.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[root@192 ~]#

cmake也更新了。我们开始编译mysql

[root@192 mysql-8.0.16]# cd build/
[root@192 build]#cmake .. -DWITH_BOOST=../boost -DBUILD_CONFIG=mysql_release -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
Cannot find appropriate system libraries for WITH_SSL=system.
Make sure you have specified a supported SSL version.
Valid options are :
system (use the OS openssl library),
yes (synonym for system),
</path/to/custom/openssl/installation>,
wolfssl (use wolfSSL. See extra/README-wolfssl.txt on how to set this up)

CMake Error at cmake/ssl.cmake:68 (MESSAGE):
  Please install the appropriate openssl developer package.

Call Stack (most recent call first):
  cmake/ssl.cmake:413 (FATAL_SSL_NOT_FOUND_ERROR)
  CMakeLists.txt:1002 (MYSQL_CHECK_SSL)

提示没有openssl开发支持

[root@192 build]# yum install openssl-devel

补充,继续

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: _GNU_SOURCE;_FILE_OFFSET_BITS=64;RAPIDJSON_NO_SIZETYPEDEFINE;HAVE_CONFIG_H;HAVE_OPENSSL;__STDC_LIMIT_MACROS;__STDC_FORMAT_MACROS;_USE_MATH_DEFINES;LZ4_DISABLE_DEPRECATE_WARNINGS;HAVE_LIBEVENT2;UNISTR_FROM_STRING_EXPLICIT=explicit;UNISTR_FROM_CHAR_EXPLICIT=explicit
-- CMAKE_C_FLAGS: -fPIC -fno-omit-frame-pointer   -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Wwrite-strings -Wjump-misses-init
-- CMAKE_CXX_FLAGS: -fPIC -std=c++14 -fno-omit-frame-pointer   -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Woverloaded-virtual -Wlogical-op
-- CMAKE_CXX_FLAGS_DEBUG: -DSAFE_MUTEX -DENABLED_DEBUG_SYNC -g
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -DDBUG_OFF -ffunction-sections -fdata-sections -O2 -g -DNDEBUG
-- CMAKE_CXX_FLAGS_RELEASE: -DDBUG_OFF -ffunction-sections -fdata-sections -O3 -DNDEBUG
-- CMAKE_CXX_FLAGS_MINSIZEREL: -DDBUG_OFF -ffunction-sections -fdata-sections -Os -DNDEBUG
-- CMAKE_C_LINK_FLAGS:  -fuse-ld=gold -Wl,--gc-sections
-- CMAKE_CXX_LINK_FLAGS:  -fuse-ld=gold -Wl,--gc-sections
-- CMAKE_EXE_LINKER_FLAGS
-- CMAKE_MODULE_LINKER_FLAGS
-- CMAKE_SHARED_LINKER_FLAGS
-- Configuring done
-- Generating done
-- Build files have been written to: /root/mysql-8.0.16/build

配置成功了。最后有个Doxygen的提示,这个是生产文档的,没有关系,没文档,我们上网查。
开始编译mysql,很好,还有进度条。开始喝咖啡吧。为加快进度,我们启用10个并行编译。

[root@192 build]#
[root@192 build]# make -j 10
Scanning dependencies of target INFO_SRC
[  0%] Built target INFO_SRC
Scanning dependencies of target INFO_BIN
[  0%] Built target INFO_BIN
Scanning dependencies of target abi_check
[  0%] Built target abi_check
Scanning dependencies of target zlib
[  0%] Building C object extra/zlib/CMakeFiles/zlib.dir/adler32.o
[  0%] Building C object extra/zlib/CMakeFiles/zlib.dir/compress.o
[  0%] Building C object extra/zlib/CMakeFiles/zlib.dir/crc32.o
.
.
.

[ 20%] Building CXX object extra/protobuf/protobuf-3.6.1/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message.cc.o
[ 21%] Building CXX object extra/protobuf/protobuf-3.6.1/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_builder.cc.o
[ 21%] Building CXX object extra/protobuf/protobuf-3.6.1/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_builder_lite.cc.o
[ 21%] Building CXX object extra/protobuf/protobuf-3.6.1/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_field.cc.o
[ 21%] Building CXX object extra/protobuf/protobuf-3.6.1/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_field_lite.cc.o
[ 21%] Building CXX object extra/protobuf/protobuf-3.6.1/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_lite.cc.o
.
.
.
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/dest_metadata_cache.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/dest_first_available.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/dest_next_available.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/dest_round_robin.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/routing.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/protocol/classic_protocol.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/connection.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/context.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/mysql_routing_common.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/connection_container.cc.o
[100%] Building CXX object router/src/routing/CMakeFiles/routing.dir/src/protocol/x_protocol.cc.o
[100%] Linking CXX shared library ../../../plugin_output_directory/routing.so
[100%] Built target routing

编译完成。

[root@192 build]# make install

安装后测试

  • 安装后初始化
[root@192 ~]# cd /usr/local/mysql/
[root@192 mysql]# mkdir mysql-files
[root@192 mysql]# chown mysql:mysql mysql-files/
[root@192 mysql]# chmod 755 mysql-files/
[root@192 mysql]# mysqld --initialize --user=mysql
2019-06-26T03:33:17.414299Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2019-06-26T03:33:17.416435Z 0 [System] [MY-013169] [Server] /usr/local/bin/mysqld (mysqld 8.0.16) initializing of server in progress as process 12075
2019-06-26T03:33:20.369509Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: dk>!ayw3oGt9
2019-06-26T03:33:21.426434Z 0 [System] [MY-013170] [Server] /usr/local/bin/mysqld (mysqld 8.0.16) initializing of server has completed

[root@192 mysql]#

我们创建了mysql-files目录,处于安全考虑,系统限制对数据的导入和导出,系统需要指定固定的操作目录。
系统初始化过程创建mysql模式,包括了数据字典,授权表等系统表。还初始化了系统表空间,
日志文件中输出了临时的root密码,这个必须首先先修改。

  • 启动Mysql

首先修改配置文件中的log文件和pid文件参数。

[root@192 ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/tmp/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=mysql.log
pid-file=mysql.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

启用服务。

[root@192 ~]# mysqld_safe --user=mysql&
[1] 36533
[root@192 ~]# 2019-06-27T06:47:00.657868Z mysqld_safe Logging to '/var/lib/mysql/mysql.log'.
2019-06-27T06:47:00.677550Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

[root@192 ~]#

修改临时的密码

[root@192 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.16 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> alter user 'root'@'localhost' set identified by 'newpassword';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set identified by 'newpassword'' at line 1
mysql> alter user 'root'@'localhost' identified by 'newpassword';
Query OK, 0 rows affected (0.01 sec)

mysql> exit
Bye
[root@192 ~]#

看看我们安装的Mysql

[root@192 ~]# mysqladmin version -u root -p
Enter password:
mysqladmin  Ver 8.0.16 for Linux on x86_64 (Source distribution)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Server version          8.0.16
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /tmp/mysql.sock
Uptime:                 3 min 9 sec

Threads: 2  Questions: 7  Slow queries: 0  Opens: 141  Flush tables: 3  Open tables: 45  Queries per second avg: 0.037
[root@192 ~]#
[root@192 ~]# mysqlshow -u root -p
Enter password:
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
[root@192 ~]#

一切正常。

  • 说明
    cmake 时候,系统提供了多达100多个可在编译时选择的参数,具体参数说明可以参考官方文档。我们为简单起见自己使用了Oracle官方发布的cmake参数设置(-DBUILD_CONFIG=mysql_release )。这样我们编译的这个Mysql服务器就和官方的发布版本一模一样了。
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容