MySQL5.7源码安装
[root@xjfw3 ~]# yum -y install gcc gcc-c++ ncurses ncurses-devel cmake
三、操作系统环境和目录结构
[root@xjfw3 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
[root@xjfw3 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_local-lv_root
20G 5.1G 14G 28% /
tmpfs 16G 76K 16G 1% /dev/shm
/dev/mapper/vg_local-lv_app
40G 176M 38G 1% /app
/dev/sda1 485M 55M 405M 12% /boot
/dev/mapper/vg_local-lv_home
4.0G 137M 3.7G 4% /home
/dev/sdb1 394G 2.8G 371G 1% /weblogic
四、添加mysql禁止登录的用户及目录规划
[root@xjfw3 ~]# groupadd mysql
[root@xjfw3 ~]# useradd -r -g mysql -s /sbin/nologin mysql
MySQL数据库目录划分:
mysql软件目录: /weblogic/mysql/mysql
mysql数据目录:/weblogic/mysql/datadir
mysql日志目录:/weblogic/mysql/logdir
[root@xjfw3 ~]# mkdir -p /weblogic/mysql/mysql
[root@xjfw3 ~]# mkdir -p /weblogic/mysql/datadir
[root@xjfw3 ~]# mkdir -p /weblogic/mysql/logdi
[root@xjfw3 ~]# cd /weblogic/
[root@xjfw3 weblogic]# chown -R mysql.mysql mysql/
五、解压MySQL并编译安装
1、解压Mysql
[root@xjfw3 ~]# cd /root
[root@xjfw3 ~]# ls mysql-boost-5.7.20.tar.gz
mysql-boost-5.7.20.tar.gz
[root@xjfw3 ~]# tar -xvf mysql-boost-5.7.20.tar.gz
2、编译安装
[root@xjfw3 ~]#
[root@xjfw3 ~]# cd /root/mysql-5.7.20/
[root@xjfw3 mysql-5.7.20]# cmake . \
> -DCMAKE_INSTALL_PREFIX=/weblogic/mysql/mysql \
> -DMYSQL_DATADIR=/weblogic/mysql/datadir \
> -DDOWNLOAD_BOOST=1 \
> -DWITH_BOOST=/root/mysql-5.7.20/boost \
> -DSYSCONFDIR=/etc \
> -DWITH_INNOBASE_STORAGE_ENGINE=1 \
> -DWITH_PARTITION_STORAGE_ENGINE=1 \
> -DWITH_FEDERATED_STORAGE_ENGINE=1 \
> -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
> -DWITH_MYISAM_STORAGE_ENGINE=1 \
> -DENABLED_LOCAL_INFILE=1 \
> -DENABLE_DTRACE=0 \
> -DDEFAULT_CHARSET=utf8 \
> -DDEFAULT_COLLATION=utf8_general_ci \
> -DWITH_EMBEDDED_SERVER=1
[root@xjfw3 mysql-5.7.20]# make & make install
六、配置my.cnf文件
[root@xjfw3 mysql]# vi /etc/my.cnf [client]
port=3306
socket=/weblogic/mysql/datadir/mysql.sock
default-character-set=utf8
[mysqld]
port=3306
user=mysql
socket=/weblogic/mysql/datadir/mysql.sock
pid-file=/weblogic/mysql/datadir/mysql.pid
basedir=/weblogic/mysql/mysql
datadir=/weblogic/mysql/datadir
tmpdir=/weblogic/mysql/tmpdir
character-set-server=utf8
log_error=/weblogic/mysql/logdir/mysql.err server-id=2
log_bin=/weblogic/mysql/logdir/binlog general_log_file=/weblogic/mysql/logdir/general_log
general_log=1 slow_query_log=ON
long_query_time=2
slow_query_log_file=/weblogic/mysql/logdir/query_log
log_queries_not_using_indexes=ON "/etc/my.cnf" [New] 25L, 605C written
[root@xjfw3 mysql]#
七、初始化数据库
[root@xjfw3 datadir]# cd /weblogic/mysql/mysql/bin
[root@xjfw3 bin]# ./mysqld --initialize-insecure --user=mysql --basedir=/weblogic/mysql/mysql --datadir=/weblogic/mysql/datadir/data
八、安装ssl,可指定文件生成路径,默认为DATA里面
[root@xjfw3 datadir]# cd /weblogic/mysql/mysql/bin
[root@xjfw3 bin]# ./mysql_ssl_rsa_setup
Generating a 2048 bit RSA private key
....................................+++
.....................................................................................+++
writing new private key to 'ca-key.pem'
-----
Generating a 2048 bit RSA private key
....................................................................................................................+++
..................................................................................................+++
writing new private key to 'server-key.pem'
-----
Generating a 2048 bit RSA private key
..................................+++
........+++
writing new private key to 'client-key.pem'
-----
[root@gsxjfw3 bin]#
九、启动数据库
[root@xjfw3 ~]# cp /weblogic/mysql/mysql/support-files/mysql.server /etc/init.d/msyqld
[root@xjfw3 support-files]# /etc/init.d/mysqld start
Starting MySQL.[ OK ]
[root@xjfw3 ~]# ps -ef | grep mysql
root 14979 1 0 19:57 pts/2 00:00:00 /bin/sh /weblogic/mysql/mysql/bin/mysqld_safe --datadir=/weblogic/mysql/datadir/data --pid-file=/weblogic/mysql/datadir/mysql.pid
mysql 15278 14979 0 19:57 pts/2 00:00:00 /weblogic/mysql/mysql/bin/mysqld --basedir=/weblogic/mysql/mysql --datadir=/weblogic/mysql/datadir/data --plugin-dir=/weblogic/mysql/mysql/lib/plugin --user=mysql --log-error=/weblogic/mysql/logdir/mysql.err --pid-file=/weblogic/mysql/datadir/mysql.pid --socket=/weblogic/mysql/datadir/mysql.sock --port=3306
root 15397 14855 0 20:04 pts/2 00:00:00 grep mysql
[root@xjfw3 ~]#
十、登录数据库并修改密码
[root@xjfw3 ~]# /weblogic/mysql/mysql/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.20-log Source distribution
Copyright (c) 2000, 2017, 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' identified by 'mysql';
Query OK, 0 rows affected (0.00 sec)
mysql>
十一、修改环境变量
[root@xjfw3 ~]# vi /etc/profile
PATH=/weblogic/mysql/mysql/bin:/weblogic/mysql/mysql/lib:$PATH
export PATH
"/etc/profile" 80L, 1868C written
[root@xjfw3 ~]# source /etc/profile
[root@xjfw3 ~]#
MySQL5.7源码安装的更多相关文章
- mysql5.6源码安装(转)
mysql5.6源码安装 转自 jabbok博客园 https://www.cnblogs.com/jabbok/p/9418344.html 1 编译安装 1 2 3 4 5 6 groupadd ...
- Mysql5.5源码安装步骤笔记记录
1.cmake软件的安装wget https://cmake.org/files/v3.5/cmake-3.5.0-rc3.tar.gztar xf cmake-3.5.0.tar.gzcd cmak ...
- Linux MySQL5.5源码安装
环境:CentOS7,MySQL5.5 1.MySQL5.5源码下载 Oracle的网站打开较慢,http://mirrors.sohu.com/mysql/这里提供了MySQL的镜像.一般的,Lin ...
- MYSQL5.5源码安装 linux下
/* 首先安装必要的库 */ yum -y install gcc* ###### 安装 MYSQL ###### 首先安装camke 一.支持YUM,则 yum install -y cmake 二 ...
- ubuntu mysql5.7源码安装
本系列的lnmp的大框架基本上是按照http://www.linuxzen.com/lnmphuan-jing-da-jian-wan-quan-shou-ce-si-lnmpda-jian-yuan ...
- CentOS6.5+mysql5.1源码安装过程
一:先安装依赖包(不然配置的时候会报错的!) yum -y install ncurses* libtermcap* gcc-c++* 新建mysql用户 [root@HE1Packages]# gr ...
- Linux+Apache2.4+PHP5.6+MySQL5.6源码安装步骤
一.安装Apache 若要安装apache服务器软件,需要安装以下几个依赖软件 apr-1.4.6.tar.gz 下载地址:http://apr.apache.org/ apr-util-1.4.1. ...
- mysql5.6源码安装
1.环境介绍: 包:mysql-5.6.24.tar.gz 平台:centos6.5 2.安装cmake编译工具和依赖包: yum install cmake -y yum install ncurs ...
- MySQL5.5.源码安装
MySQL5.5.34安装需要用到cmke ncurses-devel yum install -y ncurses-devel cmake gcc gcc-c++ bison 下载http://m ...
随机推荐
- python print %s 号格式化输出
python %号格式化输出: 一种字符串格式化的语法, 基本用法是将值插入到%s占位符的字符串中. %s,表示格式化一个对象为字符 "%±(正负号表示)3(数字表示字符串的长度)s&quo ...
- 吴裕雄--天生自然Django框架开发笔记:Django Nginx+uwsgi 安装配置
Django Nginx+uwsgi 安装配置 使用 python manage.py runserver 来运行服务器.这只适用测试环境中使用. 正式发布的服务,需要一个可以稳定而持续的服务器,比如 ...
- day24(024-多线程(上))
###24.01_多线程(多线程的引入)(了解) 1.什么是线程 线程是程序执行的一条路径, 一个进程中可以包含多条线程 多线程并发执行可以提高程序的效率, 可以同时完成多项工作 2.多线程的应用场景 ...
- Sequence Models Week 3 Trigger word detection
Trigger Word Detection Welcome to the final programming assignment of this specialization! In this w ...
- Arduino Wireless Communication – NRF24L01 Tutorial(arduino无线通信---NRF24L01教程)
arduino下nrf24l01库文件及相关说明 库的说明文档 https://tmrh20.github.io/RF24/ 库的源代码github下载页面 https://tmrh20.github ...
- HDU_2256 矩阵快速幂 需推算
最近开始由线段树转移新的内容,线段树学到扫描线这里有点迷迷糊糊的,有时候放一放可能会好一些. 最近突然对各种数学问题很感兴趣.好好钻研了一下矩阵快速幂.发现矩阵真是个计算神器,累乘类的运算原本要O(N ...
- Python语言基础与应用 (P23)上机练习:容器类型操作(未完待续)
上机练习:容器类型操作〉 列表.元组基本操作+, *, len(), [], in Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 ...
- Qt在vs2010下的配置
https://blog.csdn.net/chenbang110/article/details/7607250 首先不要使用中文目录, 1 下载Qt的安装包和VS2010的Qt插件 2. 安装Qt ...
- Java--类初始化
package httpclient.demo; public class StaticTest { public static void main(String[] args) { staticFu ...
- 【Gson】网页上String获取的Json数据转化为对象
1.网络上获取的String Json格式转化为对象获取数据: 需要的包:Gson Maven依赖: <!-- https://mvnrepository.com/artifact/com.go ...