1、通过官网下载对应的版本后,通过FTP上传至云服务器的/usr/local/src 目录

2、解压缩文件

[root@JSH-01 src]# ls
mysql-boost-8.0.12.tar.gz
[root@JSH-01 src]# tar zxvf mysql-boost-8.0.12.tar.gz
[root@JSH-01 src]# ls
mysql-8.0.12  mysql-boost-8.0.12.tar.gz

3、重命名文件夹

[root@JSH-01 src]# mv mysql-8.0.12  mysql
[root@JSH-01 src]# ls
mysql  mysql-boost-8.0.12.tar.gz
[root@JSH-01 src]# cd mysql
[root@JSH-01 mysql]# ls
boost           config.h.cmake    Doxyfile.in        libbinlogevents      man         plugin             sql            testclients  win
client          configure.cmake   doxygen_resources  libbinlogstandalone  mysql-test  README             sql-common     unittest
cmake           dbug              extra              libmysql             mysys       run_doxygen.cmake  storage        utilities
CMakeLists.txt  Docs              include            libservices          mysys_ssl   scripts            strings        VERSION
components      Doxyfile-ignored  INSTALL            LICENSE              packaging   share              support-files  vio

4、安装cmake工具 yum install -y cmake

5、cmake构建编译环境

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/src/mysql  -DMYSQL_DATADIR=/usr/local/src/mysql/var  -DSYSCONFDIR=/usr/local/src/mysql/etc -DWITH_DEBUG=0  -DWITH_INNODB_MEMCACHED=1  -DWITH_PARTITION_STORAGE_ENGINE=1  -DENABLED_PROFILING=0  -DCMAKE_C_FLAGS="-O3"  -DCMAKE_CXX_FLAGS="-O3"

6、cmake报错汇总:

错误1、 CMake Warning at CMakeLists.txt:185 (MESSAGE):Could not find devtoolset gcc

解决方案:yum install -y gcc

再次执行cmake编译

错误2、**-- Could NOT find Git (missing:  GIT_EXECUTABLE) **

解决方案:yum install -y git

错误3、-- The CXX compiler identification is unknown
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.

解决方案:yum install -y gcc gcc-c++

再次执行cmake编译

错误4、CMake Error at cmake/boost.cmake:101 (MESSAGE):You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>

解决方案:编译选项中增加
-DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/src/mysql
回车后,系统会自动下载并解压缩该文件

错误5、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)错误6、CMake Error at cmake/ssl.cmake:68 (MESSAGE):Please install the appropriate openssl developer package.

解决方案5:编译选项中增加 -DWITH_SSL=system

解决方案6:yum install ncurses-devel 和 yum install openssl-devel

7、执行编译 make -j N(N为线程数,一般为服务器中CPU的个数)

查看Linux系统CPU信息:

cat /proc/cpuinfo

查看Linux系统CPU物理个数:

cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l

8、cmake -j 编译过程中的错误信息

[ 56%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/handler/i_s.cc.o
错误  c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/handler/handler0alter.cc.o] Error 4
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [storage/innobase/CMakeFiles/innobase.dir/all] Error 2
make: *** [all] Error 2

解决方案:根据错误信息提示 internal compiler error: Killed (program cc1plus) 判断为编译过程中内存耗尽, 导致了编译中断,解决办法就是增加一个交换分区:

[root@JSH-01 mysql]# dd if=/dev/zero of=/swapfile bs=1k count=2048000    //创建分区文件, 大小 2G
2048000+0 records in
2048000+0 records out
2097152000 bytes (2.1 GB) copied, 16.9483 s, 124 MB/s
[root@JSH-01 mysql]# mkswap /swapfile   //生成 swap 文件系统
Setting up swapspace version 1, size = 2047996 KiB
no label, UUID=5c0b0fa8-7396-4b89-998f-29b6b269a938
[root@JSH-01 mysql]# swapon /swapfile   //激活 swap 文件
swapon: /swapfile: insecure permissions 0644, 0600 suggested.

MySQL-8.0.12源码安装实例相关推荐

  1. mysql 5.7.17 源码安装_mysql5.7.17源码安装

    创建用户和目录 groupadd mysql useradd -r -g mysql mysql mkdir -p /data/mysql/standby/data mkdir -p /data/my ...

  2. MySQL学习之路 一 : MySQL 5.7.19 源码安装

    MySQL 5.7.19 源码安装 查看系统: # cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) 安装依赖包 # yum - ...

  3. ZABIX5.0.7源码安装详细过程

    ZABIX5.0.7源码安装详细过程 Zabbix5.0源码安装文档 一:Linux初始设置 关闭selinux vi /etc/selinux/config SELINUX=disabled 关闭网 ...

  4. springboot jpa mysql大学生兼职网源码+安装视频+讲解视频+效果视频

    项目介绍: springboot jpa mysql大学生兼职网源码+安装视频+讲解视频+效果视频 高清视频演示: https://www.bilibili.com/video/BV1yY4y137U ...

  5. MySQL 8.0.22 源码编译安装全过程

    墨墨导读: Mysql的8.0版本出来已经有一段时间了,近期研究下源码调试.整个编译过程越来越复杂了. 近期研究下源码调试,MySQL5.7版本源码安装还是比较简单的,有很多例子参考.所以这次选择My ...

  6. 在 CentOS 7.0 上源码安装 Xen 4.5

    上周 CentOS 7.0 正式版发布了,Xen4CentOS 项目还没来得及更新支持 CentOS 7.0,所以目前要在 CentOS 7.0 上玩 Xen 的唯一办法只有编译源代码了.貌似这次 C ...

  7. zabbix源码安装实例

    环境 系统                 Centos7 zabbix版本      Zabbix 3.4.15 (revision 86739) zabbix源码安装 tar -zxvf zabb ...

  8. ott盒子 MySQL_Linux+Nginx+MySql+Php既LNMP源码安装

    前言: 我们都知道Apache作为一款出色的web服务器占据了市场大半个江山,他的地位目前还无人能取代,但是除了Apache,,在web服务器软件行列,Nginx以其性能稳定.功能丰富.运维简单.处理 ...

  9. .net framework 4.0安装_R4.0的源码安装——以mac为例

    装了一堆东西回来,已经忘了最初要做的是啥. 太长不看版 其实就是缺什么安装什么.每个人情况可能都不太一样.对于我的mac上,如下: configure之前需要安装: gcc xz pcre2 安装方法 ...

最新文章

  1. tum robotics
  2. mysql read timed out_java.sql.SQLException: Socket read timed out
  3. P5357 【模板】AC自动机(二次加强版)
  4. 菱形继承与菱形虚拟继承
  5. python web为什么不火_如何用纯 Python 写交互式 Web 应用?
  6. ubuntu19.10下面的redis的启动与关闭
  7. Entity Framework Core 实现MySQL 的TimeStamp/RowVersion 并发控制
  8. 交通违章处理的一般程序
  9. Linux 字符设备驱动开发基础(二)—— 编写简单 PWM 设备驱动
  10. IBM收购数据库安全公司 围剿Oracle之心不死
  11. Eclipse R语言插件 statET 安装
  12. MVP小白入门,只需5步
  13. 【管理心得之三】管理者们扪心自问一下 “你们杀了几个属下”
  14. Makefile.am:1: error: Libtool library used but 'LIBTOOL' is undefined
  15. 在python中使用csv读写CSV
  16. 用计算机看手机照片大小,手机怎么知道照片多少k
  17. SVN:本地项目与SVN项目进行关联
  18. chromium git下载
  19. CVPR 2021 Pre-Trained Image Processing Transformer
  20. 数据分析-思维分析逻辑day04

热门文章

  1. 韦根w34是多少位_韦根接口读卡器说明书
  2. 雨棚板弹性法计算简图_钢结构工程量计算、报价要点
  3. pyplot输出的绘图界面中文乱码的解决方案
  4. python之布尔值——待补充……
  5. 7-1 FireTruck 消防车 uva208
  6. 嵌入式Linux下Qt的中文显示
  7. 微信小程序----全局变量
  8. banner轮播无缝滚动 jq代码
  9. 解决mac升级后,出现的 xcrun: error: invalid active developer path, missing xcrun 错误
  10. oracle数据库连接 ORA-12638:身份证明检索失败