centos6.7下 编译安装MySQL5.7
centos6.7下编译安装MySQL5.7
准备工作
#-----依赖包及MySQL和boost安装包-----
#yum包安装:
shell> yum -y install gcc-c++ ncurses-devel cmake make perl gcc autoconf automake zlib libxml libgcrypt libtool bison #获取boost类库(.7编译需要boost类库,编译时指定boost路径):
shell> wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz #获取MySQL5.
shell> wget http://cdn.mysql.com/Downloads/MySQL-5.7/mysql-5.7.9.tar.gz
#-----创建MySQL用户及相关目录-----
shell> groupadd mysql #创建MySQL组
shell> useradd -g501 mysql #创建MySQL用户
shell> mkdir -p /data/mysql #创建MySQL安装目录
shell> mkdir /data/mysqlData #创建MySQL数据库文件存放目录
shell> chown -R mysql:mysql /data/mysql /data/mysqlData
#-----Cmake-----
shell> tar -zxvf ./mysql-5.7..tar.gz
shell> cd ./mysql-5.7.
shell> cmake \
-DCMAKE_INSTALL_PREFIX=/data/mysql \
-DSYSCONFDIR=/data/mysql/ \
-DMYSQL_DATADIR=/data/mysqlData/ \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DMYSQL_TCP_PORT= \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_READLINE= \
-DENABLED_LOCAL_INFILE= \
-DWITH_MYISAM_STORAGE_ENGINE= \
-DWITH_INNOBASE_STORAGE_ENGINE= \
-DWITH_PARTITION_STORAGE_ENGINE= \
-DWITH_MEMORY_STORAGE_ENGINE= \
-DWITH_BOOST=/usr/local/boost
shell> make -j `grep processor /proc/cpuinfo | wc -l`
shell> make install
*比较耗系统资源 配置低编译可能会很慢* #初始化数据库 #创建配置文件 根据实际使用情况修改 仅供参考
cat > /data/mysql/my.cnf << EOF
[client]
port =
socket = /tmp/mysql.sock
default-character-set = utf8mb4 [mysqld]
port =
socket = /tmp/mysql.sock basedir = /data/mysql
datadir = /data/mysqlData
pid-file = /data/mysqlData/mysql.pid
user = mysql
bind-address = 0.0.0.0
server-id = init-connect = 'SET NAMES utf8mb4'
character-set-server = utf8mb4 #skip-name-resolve
#skip-networking
back_log = max_connections =
max_connect_errors =
open_files_limit =
table_open_cache =
max_allowed_packet = 4M
binlog_cache_size = 1M
max_heap_table_size = 8M
tmp_table_size = 16M read_buffer_size = 2M
read_rnd_buffer_size = 8M
sort_buffer_size = 8M
join_buffer_size = 8M
key_buffer_size = 4M thread_cache_size = query_cache_type =
query_cache_size = 8M
query_cache_limit = 2M ft_min_word_len = log_bin = mysql-bin
binlog_format = mixed
expire_logs_days = log_error = /data/mysqlData/mysql-error.log
slow_query_log =
long_query_time =
slow_query_log_file = /data/mysqlData/mysql-slow.log performance_schema =
explicit_defaults_for_timestamp #lower_case_table_names = skip-external-locking default_storage_engine = InnoDB
#default-storage-engine = MyISAM
innodb_file_per_table =
innodb_open_files =
innodb_buffer_pool_size = 64M
innodb_write_io_threads =
innodb_read_io_threads =
innodb_thread_concurrency =
innodb_purge_threads =
innodb_flush_log_at_trx_commit =
innodb_log_buffer_size = 2M
innodb_log_file_size = 32M
innodb_log_files_in_group =
innodb_max_dirty_pages_pct =
innodb_lock_wait_timeout = bulk_insert_buffer_size = 8M
myisam_sort_buffer_size = 8M
myisam_max_sort_file_size = 10G
myisam_repair_threads = interactive_timeout =
wait_timeout = [mysqldump]
quick
max_allowed_packet = 16M [myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M
EOF
#生成系统表
shell> /usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql
shell> service mysqld start
*注*:
1. 之前版本mysql_install_db是在mysql_basedir/script下,5.7放在了mysql_install_db/bin目录下,且已被废弃,使用--initialize-insecure。
2. –-initialize会生成一个随机密码(~/.mysql_secret),--initialize-insecure不会生成密码
#-----设置环境变量,加入开机启动-----
shell> echo 'export PATH=$PATH:/data/mysql/bin/' >> /etc/profile
shell> source /etc/profile
chkconfig --add myslqd
chkconfig mysqld on
#-----配置mysql的root密码-----
shell> mysql
mysql> set password for 'root'@'localhost' = password('qwerasdfzxcv');
mysql> flush privileges;
centos6.7下 编译安装MySQL5.7的更多相关文章
- CentOS6.5_64bit下编译安装MySQL-5.6.23
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************** ...
- centos6.6下编译安装mysql5.6之后启动失败:Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).
今天在编译安装mysql5.6时候出现Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysq ...
- CentOS6.9 下编译安装MySQL5.7.19
官网:https://www.mysql.com/ 下载地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz 一.准备工作 ...
- CentOS6.5下编译安装LAMP环境
LAMP(Linux-Apache-MySQL-PHP)网站架构是目前国际流行的Web框架.该框架能够满足大流量.大并发量的网站需求:当然.也可以直接使用高性能的服务器.高性能的负载均衡硬件以及CDN ...
- centos6.7下编译安装lnmp
很多步骤不说明了,请参照本人的centos6.7下编译安装lamp,这次的架构是nginx+php-fpm一台服务器,mysql一台服务器 (1)首先编译安装nginx: 操作命令: yum -y g ...
- Linux(CentOS6.5)下编译安装PHP5.6.22时报错”configure: error: ZLIB extension requires gzgets in zlib”的解决方式(确定已经编译安装Zlib,并已经指定Zlib路径)
本文地址http://comexchan.cnblogs.com/,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢! 今天在CentOS6.5下编译安装PHP时,一直报错 confi ...
- centos6.5下编译安装单实例MySQL5.5
MySQL5.5版本安装3步曲: 1) cmake 2) make 3) make install 查看系统版本号 [root@meinv01 ~]# cat /etc/redhat-release ...
- centos6.5下编译安装单实例MySQL5.1
MySQL5.1版本安装3步曲: 1) ./config 指定编译安装参数 2) make 3) make install 查看系统版本号 [root@meinv01 ~]# cat /etc/red ...
- centos下编译安装mysql5.6
CentOS 6.4下编译安装MySQL 5.6.14 参考:http://www.cnblogs.com/xiongpq/p/3384681.html 概述: CentOS 6.4下通过yum安装的 ...
随机推荐
- 转:socket通信简介
转:http://blog.csdn.net/xiaoweige207/article/details/6211577/ 我们深谙信息交流的价值,那网络中进程之间如何通信,如我们每天打开浏览器浏览网页 ...
- COJ 0358 xjr考考你数据结构(根号3)线段树区间修改
xjr考考你数据结构(根号3) 难度级别:C: 运行时间限制:1000ms: 运行空间限制:51200KB: 代码长度限制:2000000B 试题描述 请你编写一个数据结构,完成以下功能: 1)求出第 ...
- java并发4-单例设计方法
单例的设计方式: 第一种:非延迟加载单例类 public class Singleton { private Singleton() {} private static final Singleton ...
- WEB/ WCF安全认证
- C++中使用stringstream进行类型转换操作
stringstream包括istringstream和ostringstream,提供读写string的功能,使用时需包含stream文件.4个操作:1. stringstream strm; 创建 ...
- libvirt TLS
博客原文 http://hi.baidu.com/wwfmarcpjkbdiod/item/7b43c89e949d7fbbcd80e590 构建Libvirt的x509证书远程tls连接http:/ ...
- for
1,cout在显示bool值之前将他们转换为int,但cout.setf(ios::boolalpha)函数调用设置了一个标记,标记命令cout显示true 和 false 而不是 1 和0;
- eclipse与myeclipse工程互转
eclipse转myeclipse: 在Myeclipse中新建web工程导入即可. myeclipse转eclipse: 在eclipse中新建web工程,把myeclipse项目中代码手动拷贝到 ...
- <WinForm_1>初识WinForm编程
暑假花了一个多月自学了Win32 SDK编程,不敢说成为了高手,但是还是颇具收获——windows的消息机制(著名的消息循环).一切控件均是窗口…… 曾经有一位网友(和我一个专业的)向我吐槽:Win3 ...
- MVC 4.0语法 自动分页
4.0语法中实现自动分页只需要两个方法即可,Skip() ----跳过序列中指定的元素,Take()-----从序列的开头返回指定数量元素. 一般用自动分页都是无刷新的,可以把显示的数据,用局部页面封 ...