编译安装MySQL-5.7.13
编译安装MySQL-5.7
cmake的重要特性之一是其独立于源码(out-of-source)的编译功能,即编译工作可以在另一个指定的目录中而非源码目录中进行,这可以保证源码目录不受任何一次编译的影响,因此在同一个源码树上可以进行多次不同的编译,如针对于不同平台编译。
编译安装MySQL-5.7
+++++++++++++++++++++++++
OS:centos7 & 3.10.0-327.el7.x86_64
MySQL:mysql-boost-5.7.13.tar.gz
+++++++++++++++++++++++++
一、安装cmake
跨平台编译器
https://cmake.org/download/
# wget https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz # tar xf cmake-3.5..tar.gz
# cd cmake-3.5. # yum install -y make gcc gcc-c++ ncurses-devel # ./bootstrap
# gmake
# gmake install
二、编译安装mysql
0. 下载MySQL
# wget http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.13.tar.gz
1、使用cmake编译mysql-5.7
cmake指定编译选项的方式不同于make,其实现方式对比如下:
make |cmake
---------------------|--------------------------
./configure |cmake .
./configure --help |cmake . -LH or ccmake .
-L[A][H]
List non-advanced cached variables.
List cache variables will run CMake and list all the variables from the CMake cache that are not marked as INTERNAL or ADVANCED. This will effectively display current CMake settings, which can then be changed with -D option. Changing some of the variables may result in more variables being created. If A is specified, then it will display also advanced variables. If H is specified, it will also display help for each variable.
指定安装文件的安装路径时常用的选项:
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/data/mysql
-DSYSCONFDIR=/etc
默认编译的存储引擎包括:csv、myisam、myisammrg和heap。若要安装其它存储引擎,可以使用类似如下编译选项:
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_ARCHIVE_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITH_FEDERATED_STORAGE_ENGINE=1
若要明确指定不编译某存储引擎,可以使用类似如下的选项:
-DWITHOUT_<ENGINE>_STORAGE_ENGINE=1
比如:
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
-DWITHOUT_FEDERATED_STORAGE_ENGINE=1
-DWITHOUT_PARTITION_STORAGE_ENGINE=1
如若要编译进其它功能,如SSL等,则可使用类似如下选项来实现编译时使用某库或不使用某库:
-DWITH_READLINE=1
-DWITH_SSL=system
-DWITH_ZLIB=system
-DWITH_LIBWRAP=0
其它常用的选项:
-DMYSQL_TCP_PORT=3306
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock
-DENABLED_LOCAL_INFILE=1
-DEXTRA_CHARSETS=all
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DWITH_DEBUG=0
-DENABLE_PROFILING=1
如果想清理此前的编译所生成的文件,则需要使用如下命令:
make clean
rm CMakeCache.txt
2、编译安装
从MySQL 5.7.5开始Boost库是必需的
下载 mysql-boost-5.7.12.tar.g 在 cmake 指定参数 -DWITH_BOOST=boost/boost_1_59_0/
或直接cmake指定参数 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory> 系统会下载 boost
# mkdir -p /usr/local/mysql /mydata/data
# groupadd -r mysql
# useradd -g mysql -r -d /data/mydata mysql
# chown -R mysql.mysql /usr/local/mysql /mydata/data # wget http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
# tar xf mysql-boost-5.7..tar.gz
# cd mysql-5.7.
# yum install -y openssl openssl-devel # cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/mydata/data \
-DSYSCONFDIR=/etc \
-DWITH_INNOBASE_STORAGE_ENGINE= \
-DWITH_ARCHIVE_STORAGE_ENGINE= \
-DWITH_BLACKHOLE_STORAGE_ENGINE= \
-DWITH_READLINE= \
-DWITH_LIBWRAP= \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_BOOST=/home/alex/Downloads/boost_1_59_0 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
提示错误,需要安装bison*
CMake Warning at cmake/bison.cmake: (MESSAGE):
Bison executable not found in PATH
Call Stack (most recent call first):
sql/CMakeLists.txt: (INCLUDE) CMake Warning at cmake/bison.cmake: (MESSAGE):
Bison executable not found in PATH
Call Stack (most recent call first):
libmysqld/CMakeLists.txt: (INCLUDE)
# yum -y install bison*
# make
# make install
配置MySQL并启动。
# cp ./support-files/mysql.server /etc/init.d/mysqld
# chmod +x /etc/init.d/mysqld
# chkconfig --add mysqld
# chkconfig mysqld on
# chkconfig | grep mysql
mysqld :off :off :on :on :on :on :off # usermod -d /home/mysql -p mysql -s /bin/bash mysql # pwd
/usr/local/mysql
# mkdir mysql-files
# chmod mysql-files
# chown -R mysql.mysql ../mysql/ # ./bin/mysqld --initialize --user=mysql
--04T12::.885226Z [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
--04T12::.765474Z [Warning] InnoDB: New log files created, LSN=
--04T12::.029232Z [Warning] InnoDB: Creating foreign key constraint system tables.
--04T12::.165514Z [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 2a23590f-41e5-11e6-822e-000c29d052cc.
--04T12::.168762Z [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
--04T12::.935023Z [Warning] CA certificate ca.pem is self signed.
--04T12::.242525Z [Note] A temporary password is generated for root@localhost: YwSv2mg(tryr
# ./bin/mysql_ssl_rsa_setup # chown mysql.mysql ./mysql-files/ # mysql -u root -p
Enter password:YwSv2mg(tryr
mysql> set password for 'root'@'localhost'=password('root');
Query OK, rows affected, warning (0.00 sec) mysql> [root@localhost mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. Source distribution Copyright (c) , , 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>
mysql>
编译安装MySQL-5.7.13的更多相关文章
- 在CentOS上编译安装MySQL 5.7.13步骤详解
MySQL 5.7主要特性 更好的性能 对于多核CPU.固态硬盘.锁有着更好的优化,每秒100W QPS已不再是MySQL的追求,下个版本能否上200W QPS才是用户更关心的. 更好的InnoDB存 ...
- Linux编译安装Mysql步骤
一. Centos 用 wget 下载需要的软件,保存到目录/home/zwl/MySql/下 wget http://dev.mysql.com/get/Downloads/MySQL-5.5/my ...
- 源码编译安装 MySQL 5.5.x 实践
1.安装cmakeMySQL从5.5版本开始,通过./configure进行编译配置方式已经被取消,取而代之的是cmake工具.因此,我们首先要在系统中源码编译安装cmake工具. # wget ht ...
- 源码编译安装 MySQL 5.5.x 实践(转)
1.安装cmakeMySQL从5.5版本开始,通过./configure进行编译配置方式已经被取消,取而代之的是cmake工具.因此,我们首先要在系统中源码编译安装cmake工具. # wget ht ...
- Linux 环境编译安装mysql (源码安装包)
标注: Linux需要先配置网络yum源,确定yum能在线安装软件包,方便测试过程中安装部分依赖包.配置163网易提示的网络yum源参考博客 http://www.cnblogs.com/zoulo ...
- Linux下编译安装MySQL
一.环境准备yum install -y ncurses-devel libaio-develyum install -y cmake makeuseradd -s /sbin/nologin -M ...
- 编译安装MySQL 5.5.33
环境要求: 主机名 IP地址 需要软件及版本 系统版本 mysql.mfyxw.com 192.168.80.135 Mysql5.5.33 5.5.33 1.设定主机名 hostnamectl se ...
- CentOS Linux下编译安装MySQL
本文参考张宴的Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)[原创]完成.所有操作命令都在CentOS 6.4 64位操作系统下实践 ...
- CentOS 编译安装 mysql
1.前期准备 1.1 环境说明: 操作系统: CentOS release 6.4 (Final) [查看命令 cat /etc/redhat-release ] mysql : mysql-5.6. ...
- Linux CentOS6.5下编译安装MySQL 5.6.16【给力详细教程】
一.编译安装MySQL前的准备工作 安装编译源码所需的工具和库 yum install gcc gcc-c++ ncurses-devel perl 安装cmake,从http://www.cmake ...
随机推荐
- 11.2.0.4rac service_name参数修改
环境介绍 )客户环境11. 两节点 rac,集群重启后,集群资源一切正常,应用cs架构,连接数据库报错,提示连接对象不存在 )分析报错原因,连接数据库方式:ip:Port/service_name方式 ...
- 【leetcode】53-MaximumSubarray
problem MaximumSubarray code class Solution { public: int maxSubArray(vector<int>& nums) { ...
- flask数据库的迁移
需要的插件:flask-migrate 在每次修改模型之后,将修改的东西映射到数据库中. 使用flask-migrate 必须借助flask_scripts,这个包的所有MigrateCommand ...
- 测试那些事儿—web测试方法之输入框
一.字符型输入 (1)字符型输入框 英文全角,英文半角,数字,空或者空格,特殊字符“~!@#¥%.......&*?{}[]"特别要注意单引号和&符号.禁止直接输入特殊字符时 ...
- hello1.java内容简单介绍
双击该Hello.java文件以查看它. 在Hello类,称为管理bean类,提供了getter和setter方法name中的Facelets页面表达式中使用属性.默认情况下,表达式语言引用类名,第一 ...
- POJ3070 Fibonacci(矩阵快速幂加速递推)【模板题】
题目链接:传送门 题目大意: 求斐波那契数列第n项F(n). (F(0) = 0, F(1) = 1, 0 ≤ n ≤ 109) 思路: 用矩阵乘法加速递推. 算法竞赛进阶指南的模板: #includ ...
- PSP Daily桌面软件Beta阶段WBS以及PSP【王者荣耀交流协会】
一.WBS 工具:ProcessOn,请访问网址[https://www.processon.com/]. 分解思路:功能是什么/功能实现步骤?技术原型demo? 二.PSP
- 简单说明 Virtual DOM 为啥快
Virtual DOM 就是用 JS 的对象来描述 DOM 结构的一个 DOM 树.如: var element = { tagName: 'ul', // 节点标签名 props: { // DOM ...
- Gravitational Teleport简单使用
使用官方提供的二进制包进行快速启动测试,详细细节还需要在学习 下载软件包 mac 系统 https://gravitational.com/teleport/download/ wget https: ...
- 替换元素(replace,replace_if,replace_copy,replace_copy_if)
replace 审阅range中的每个元素,把old_value替换为new_value template <class ForwardIterator,class T> void rep ...