MySQL5.7 Linux7.4源码安装

Linux源码编译安装lamp(非常详细、跟着照做绝对能成功) /这条命令的目的是将ApacheHTTP服务器的控制脚本apachectl的内容复制到系统的初始化脚本位置/etc/init.d/httpd,同时使用`grep-v"#"``过滤掉所有以井号(#)开头的行,这些行通常是注释。根据图中提示错误信息,想到刚在配置文件:/etc/my.cnf中指定错误日志文件:/usr/local/mysql/mysql.log文件没有创建。mkdir会先创建:/usr/local/mysql目录,再创建:/usr/local/mysql/data目录。 阅读详情

1、环境和安装包准备

[root@kkk ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)

mysql-boost-5.7.29.tar.gz安装包可以去官网下载

[root@kkk ~]# ls -l /soft/mysql-boost-5.7.29.tar.gz 
-rw-r--r-- 1 root root 51417554 Feb 19 23:41 /soft/mysql-boost-5.7.29.tar.gz

2、目录规划

#basedir
/app/mysql
#datadir
/app/mysql/data
#logdir
/app/mysql/log

3、创建相关mysql用户组及相关目录

创建mysql用户及组
[root@kkk home]# groupadd mysql
[root@kkk home]# useradd -g mysql -s /bin/nologin mysql

创建mysql basedir datadir logdir
[root@kkk home]# mkdir -p /app/mysql/data
[root@kkk home]# mkdir -p /app/mysql/log

export MYSQL_BASE=/app/mysql
export MYSQL_DATA=/app/mysql/data
export MYSQL_LOG=/app/mysql/log

chown -R mysql:mysql /app/mysql

[root@kkk ~]# grep "mysql" /etc/passwd
mysql:x:1003:1011::/home/mysql:/bin/nologin

4、安装mysql相关包

yum -y install cmake bison bison-devel libaio-devel gcc gcc-c++ git ncurses-devel
yum -y install openssl-devel*

5、编译安装mysql

tar -xzvf mysql-boost-5.7.29.tar.gz -C /app/mysql

cd /app/mysql/mysql-5.7.29

cmake \
-DBUILD_CONFIG=mysql_release \
-DCMAKE_INSTALL_PREFIX=/app/mysql \
-DMYSQL_DATADIR=/app/mysql/data \
-DSYSCONFDIR=/etc \
-DMYSQL_UNIX_ADDR=/app/mysql/mysql.sock \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci  \
-DWITH_BOOST=boost \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_EMBEDDED_SERVER=OFF

make
make install

创建mysql配置文件

cat /etc/my.cnf

[mysqld]
basedir=/app/mysql
datadir=/app/mysql/data
socket=/app/mysql/mysql.sock
log_error=/app/mysql/log/mysqld.log
server-id=1
explicit_defaults_for_timestamp=true

设置PATH
echo "export PATH=/app/mysql/bin:$PATH" 1>> /etc/profile
source /etc/profile

初始化mysql
/app/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/app/mysql --datadir=/app/mysql/data

6、设置mysql开机启动

[root@kkk system]# cp /app/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@kkk system]# /etc/init.d/mysqld start
Starting MySQL. SUCCESS! 
[root@kkk system]# /etc/init.d/mysqld stop
Shutting down MySQL.. SUCCESS! 

[root@kkk system]# chkconfig mysqld on

[root@kkk system]# chkconfig --list mysqld

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

mysqld         	0:off	1:off	2:on	3:on	4:on	5:on	6:off

创建软连接
ln -s /app/mysql/bin/mysqld /sbin/mysqld

7、配置mysql安全向导

配置安全向导前在/etc/my.cnf中添加低配置密码策略

validate_password_policy=LOW
validate_password_length=4

systemctl start mysqld
[root@kkk ~]# mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Please set the password for root here.

New password: 

Re-enter new password: 

Estimated strength of the password: 50 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done! 

8、查看是否安装成功

[root@kkk ~]# systemctl status mysqld
?.mysqld.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
   Active: active (running) since Thu 2020-02-20 01:02:44 CST; 1min 59s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1421 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/mysqld.service
           ?..1526 /bin/sh /app/mysql/bin/mysqld_safe --datadir=/app/mysql/data --pid-file=/app/mysql/data/kk...
           ?..1825 /app/mysql/bin/mysqld --basedir=/app/mysql --datadir=/app/mysql/data --plugin-dir=/app/mys...

Feb 20 01:02:32 kkk systemd[1]: Starting LSB: start and stop MySQL...
Feb 20 01:02:44 kkk mysqld[1421]: Starting MySQL........... SUCCESS!
Feb 20 01:02:44 kkk systemd[1]: Started LSB: start and stop MySQL.
[root@kkk ~]# mysql -hlocalhost -uroot -p******
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.29 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, 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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> system ls -l /app/mysql/log/mysqld.log
-rw-r----- 1 mysql mysql 51002 Feb 20 01:02 /app/mysql/log/mysqld.log
mysql> system ls -l /app/mysql
total 328
drwxr-xr-x  2 root  root    4096 Feb 20 00:24 bin
drwxr-xr-x  5 mysql mysql   4096 Feb 20 01:02 data
drwxr-xr-x  2 root  root    4096 Feb 20 00:24 docs
drwxr-xr-x  3 root  root    4096 Feb 20 00:24 include
drwxr-xr-x  4 root  root    4096 Feb 20 00:24 lib
-rw-r--r--  1 root  root  276202 Dec 18 20:59 LICENSE
drwxr-xr-x  2 mysql mysql   4096 Feb 20 00:27 log
drwxr-xr-x  4 root  root    4096 Feb 20 00:24 man
drwxr-xr-x 38  7161 31415   4096 Feb 20 00:24 mysql-5.7.29
srwxrwxrwx  1 mysql mysql      0 Feb 20 01:02 mysql.sock
-rw-------  1 mysql mysql      5 Feb 20 01:02 mysql.sock.lock
drwxr-xr-x 10 root  root    4096 Feb 20 00:24 mysql-test
-rw-r--r--  1 root  root     587 Dec 18 20:59 README
-rw-r--r--  1 root  root     587 Dec 18 20:59 README-test
drwxr-xr-x 28 root  root    4096 Feb 20 00:24 share
drwxr-xr-x  2 root  root    4096 Feb 20 00:24 support-files
mysql> system ls -l /app/mysql/data
total 122944
-rw-r----- 1 mysql mysql       56 Feb 20 00:27 auto.cnf
-rw------- 1 mysql mysql     1676 Feb 20 00:27 ca-key.pem
-rw-r--r-- 1 mysql mysql     1112 Feb 20 00:27 ca.pem
-rw-r--r-- 1 mysql mysql     1112 Feb 20 00:27 client-cert.pem
-rw------- 1 mysql mysql     1680 Feb 20 00:27 client-key.pem
-rw-r----- 1 mysql mysql      298 Feb 20 00:57 ib_buffer_pool
-rw-r----- 1 mysql mysql 12582912 Feb 20 01:02 ibdata1
-rw-r----- 1 mysql mysql 50331648 Feb 20 01:02 ib_logfile0
-rw-r----- 1 mysql mysql 50331648 Feb 20 00:27 ib_logfile1
-rw-r----- 1 mysql mysql 12582912 Feb 20 01:02 ibtmp1
-rw-r----- 1 mysql mysql        5 Feb 20 01:02 kkk.pid
drwxr-x--- 2 mysql mysql     4096 Feb 20 00:27 mysql
drwxr-x--- 2 mysql mysql     4096 Feb 20 00:27 performance_schema
-rw------- 1 mysql mysql     1680 Feb 20 00:27 private_key.pem
-rw-r--r-- 1 mysql mysql      452 Feb 20 00:27 public_key.pem
-rw-r--r-- 1 mysql mysql     1112 Feb 20 00:27 server-cert.pem
-rw------- 1 mysql mysql     1676 Feb 20 00:27 server-key.pem
drwxr-x--- 2 mysql mysql    12288 Feb 20 00:27 sys
Java Web 图书管理系统的制作指南 实现对图书信息的增删改查(CRUD)操作。支持用户登录与权限管理。图书借阅与归还功能。系统管理员可以管理用户信息和图书库存。 阅读详情

相关推荐

【阿里云大模型高级工程师ACP习题集】2.4 自动化评测答疑机器人的表现(⭐️⭐️⭐️ 重点章节!!!)

【摘要】这是我精心整理出对应的习题集,里面足足有 30 道题目,从基础概念到深度拓展,全方位覆盖章节重点、难点。不管你是想检验自己的学习成果,还是想针对薄弱环节进行强化训练,它都能完美适配!

davidkorhenn的博客 2477

shell脚本:编译安装MySQL5.7

【代码】shell脚本:编译安装MySQL5.7。

qq_52251769的博客 704

基于STM32的Keil5代码自动补全设置操作指南

掌握Keil5代码自动补全设置技巧,提升STM32开发效率。通过合理配置编辑器选项,实现智能提示与语法补全,让嵌入式编程更流畅,尤其适合使用keil5代码自动补全设置的开发者快速上手。

weixin_32287387的博客 762

CentOS7源码编译安装MySQL5.7.30

CentOS7源码编译安装MySQL5.7.30 本来以为安装过Redis以及MySQL的rpm包源码安装那是手到擒来,结果墨迹了半个月,对你没看错就是半个月~ 从阅读cmake编译参数到my.cnf文件我把官方文档看了个遍~ 网上大神写的也是阅遍了,但大都千篇一律,有的是远古版本安装,有的根本运行不了,有的甚至参数名都写错了,还都错的一样,当然还有些确实写的不错~ 所以我决定直接看官方文档,毕竟...

Wenx 3804

Paypal开发者中心获取“ClientId”和“ClientSecret”参数

正式环境设置 1、登录到 paypal开发者中心 网址:https://developer.paypal.com/developer/ 点击右上角登录按钮登录 2、左侧栏 - 我的应用程序和凭证 - 点击“创建新应用” 新注册的paypal账号,需要进行邮箱验证,验证通过后,需要等待一段时间(或重新登录),才会出现相关设置项位置 验证邮箱通过后,点击创建新应用 3、按提示填写,保存创建应用 4、点击刚创建的应用进入应用详情页 5、应用详情页获得网站开发人员所需要的“ClientId”和“Client

龚清林的博客 1万+

dell r630 配置raid_DELL服务器RAID配置图文教程

名称解释:Disk Group:磁盘组,这里相当于是阵列,例如配置了一个RAID5,就是一个磁盘组VD(Virtual Disk): 虚拟磁盘,虚拟磁盘可以不使用阵列的全部容量,也就是说一个磁盘组可以分为多个VDPD(Physical Disk): 物理磁盘HS:Hot Spare 热备Mgmt:管理【一】创建逻辑磁盘1、按照屏幕下方的虚拟磁盘管理器提示,在VD Mgmt菜单(可以通过CTRL+P...

weixin_33253741的博客 3510

在linux上部署MySQL(源码安装)

在linux上部署服务组件MySQL,源码安装

2301_77279557的博客 591

Linux系统遭遇挖矿病毒深度排查与根治指南

本文提供了一份详尽的Linux服务器挖矿病毒排查与根治指南。当CPU异常满载但常规top命令无法定位进程时,需警惕病毒通过ld.so.preload文件隐藏。文章逐步指导如何清除恶意文件、进程、定时任务,并重点应对pamdicks等顽固变种,最后给出深度排查与系统加固方案,确保服务器安全。

weixin_29207533的博客 452

MySQL——源码安装教程

本篇为MySQL的安装中具体的源码安装以及配置,详细内容包含了:MySQL的安装 1、RPM 2、二进制 3、源码 源码安装方式安装过程 1、上传源码包2、解压当前文件并安装更新依赖3、对MySQL进行编译安装等等

钟言的博客 9818

Kubernetes(K8s)从入门到精通系列之一:一篇文章了解K8s全部核心知识点

Kubernetes(K8s)从入门到精通系列之一:一篇文章了解K8s全部核心知识点

zhengzaifeidelushang的博客 849

数字IC/FPGA 秋招知识点不全面整理

数字IC/FPGA 秋招知识点不全面整理

w0shishabi的博客 7866

mysql

1.1.1、 卸载boost MySQL从5.7.5版本之后,必须有boost库的支持(mysql源码中用到了C++的boost库,要求必须安装boost1.59.0或以上版本),建议把系统自带的boost库卸载,使用高版本。 [root@cong11 ~]# yum -y remove boost-* [root@cong11 ~]# rpm -ivh mysql-community-5.7.26-1.el7.src.rpm 在当前目录下生成rpmbuild的目录文件,然后在rpmbuild/SOURCE

m0_54353976的博客 377

【数据分析】比较SparCC、Pearson和Spearman相关性估计方法在合成组学数据上的表现

【数据分析】比较SparCC、Pearson和Spearman相关性估计方法在合成组学数据上的表现

专注生信领域 659

linux7编译mysql5.7安装,CentOS 7.4 使用源码包编译安装MySQL 5.7.20

使用yum安装的MySQL一般版本比较旧,但是运行稳定。如果想要尝试最新的功能或者需要指定特殊的功能的话,就需要手工进行编译安装了。一、下载安装包(一)、先下载MySQL源码,网址为:https://dev.mysql.com/downloads/mysql/:在Select Operationg System中选择Source Code;在下面的Select OS Version选择Gener...

weixin_35346265的博客 155

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Ubuntu Linux 7.04下的apache2+php4+mysql5源码安装详解

作者:zieckey(zieckey@yahoo.com.cn)All Right Reserved!Linux环境说明: Ubunut 7.04 mysql-5.0.41 httpd-2.0.53 php-4.4.7一、Apache服务器的安装mkdir /home/zieckey/programfiles/apachemkdir /home/zieckey/programfiles

聪明的解释器 4857

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

mysql5.6.4m7 linux安装_linux下MySQL 5.6源码安装

1.解压缩mysql-5.6.4-m7-tar.zip2.下载压缩包cmake-xxx.tar.gz3.安装cmake./configure --prefix=/usr/cmake_exemakeyum install bison4.创建mysql用户及用户组groupadd mysqluseradd -g mysql mysql(创建用户到用户组)5.安装mysql5.1 安装yum insta...

weixin_42452328的博客 115

linux apache2 php4,Ubuntu Linux 7.04下的apache2+php4+mysql5源码安装详解

作者:zieckey(zieckey@yahoo.com.cn)All Right Reserved!Linux环境说明:Ubunut 7.04mysql-5.0.41httpd-2.0.53php-4.4.7一、Apache服务器的安装mkdir /home/zieckey/programfiles/apachemkdir /home/zieckey/programfiles/phpmkdir ...

weixin_29817925的博客 302

linux centos7.4 安装mysql5.7.25

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_33967071的博客 157

企业部分实战---mysql 5.7.31 +php7.4.12 +nginx1.19.1源码编译

企业部分实战---mysql 5.7.31 +php7.4.12 +nginx1.19.1源码编译一、mysql5.7.31源码编译二、php7.4.12 源码编译三、nginx1.19.1 源码编译 一、mysql5.7.31源码编译 1.解压安装包 tar zxf mysql-boost-5.7.31.tar.gz cd mysql-5.7.31 yum install -y gcc gcc-c++ ncurses-devel openssl-devel camke bison 2.cmake 安装

ltsazx的博客 261

数据库学习之--Linux下Mysql源码包安装

数据库学习之--Linux下Mysql源码包安装系统环境:操作系统:RedHat EL6DB Soft:  Mysql 5.6.4-m7    Mysql 在linux下的安装方式有两种版本,一种为Binary(二进制),另外一种为Source(源码包),本文为Source Install方式。1、安装前的准备解压安装包[oracle@ogg ~]$ lsmysql-5.6.4-m7  mysql

天涯客*Blog 805

mysql源码编译安装-自己安装时的记录

部署环境 虚拟机:VMware? Workstation 12 Pro 12.5.2 build-4638234 CentOS镜像:CentOS-7-x86_64-Minimal-1708.iso 操作系统: :CentOS Linux release 7.4.1708 (Core) cat /etc/redhat-release Mysql 版本:mysql-5.6.26.tar.gz

qq_33697260的博客 307

CentOS 7 下编译安装 MySQL-5.7.21

系统环境 操作系统: CentOS Linux release 7.4.1708 (Core)MySQL版本: MySQL-5.7.21 安装前的准备 编译安装MySQL需要一些必备的组件,可以直接使用yum安装即可 yum -y install cmake ncurses-devel gcc-c++ 创建 Mysql用...

weixin_33872566的博客 136

Linux下最新版LAMP环境(源码版)搭建详细解读

LAMP的四个字母代表神马,我先解释申明下L:Linux 我用的Linux版本是 centos 7.0 A:Apache 我用的版本是 httpd-2.4.29 M:MySQL 我使用的版本是 mysql-5.7.20 P:PHP 我使用的版本是 php-7.1.11 Apache MySQL 和 PHP我采用的是源码包的安装方式安装,我们都知道Linux内置了很多牛逼的安装比如y

chmod_R_755的专栏 3022

centos6.9配置python3.6.4,mysql5.7,git

安装Python3.6.41.进入src[root@localhost /]# cd /usr/local/src 2.安装python依赖包[root@Python src]# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make 3...

zmy941110的博客 213

ESP32 S3+INMP441嵌入式音频采集实战:I2S精准配置与WAV稳定录制

WAV格式是嵌入式音频采集中最易落地的无损容器,因其无需解码库、兼容性高、可裸机DMA直写;而I2S作为硬件级同步串行总线,是保障采样精度与抗抖动能力的核心机制。在ESP32系列中,S3型号凭借双核Xtensa LX7、增强型I2S外设及USB OTG支持,成为驱动INMP441等高性能MEMS麦克风的理想平台。其关键价值在于规避了软件模拟时序导致的采样率漂移与丢帧问题,特别适用于语音识别、声学监测等对时间敏感的应用场景。本文聚焦I2S物理层配置、电源完整性设计与WAV头动态生成三大技术支点,解决底噪大、采

weixin_30235225的博客 378
上一篇: Oracle中使用Hint对目标SQL进行优化时几种被忽略的情况
下一篇: MySQL启用二进制日志
Lissen_Gan
博客等级 码龄13年 11粉丝 44原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值