iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >MySQL5.6源码编译安装的流程
  • 892
分享到

MySQL5.6源码编译安装的流程

2024-04-02 19:04:59 892人浏览 独家记忆
摘要

本篇内容主要讲解“Mysql5.6源码编译安装的流程”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“mysql5.6源码编译安装的流程”吧!

本篇内容主要讲解“Mysql5.6源码编译安装的流程”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习mysql5.6源码编译安装的流程”吧!

(1) 关闭防火墙和Selinux
[root@localhost ~]# service iptables status
iptables: Firewall is not running.
[root@localhost ~]# cat /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
[root@localhost ~]# chkconfig iptables off

(2) 下载Mysql 5.6源码包
https://dev.mysql.com/downloads/mysql/5.6.html#downloads
下载完毕后,上传源码包到服务器

(3) 添加用户和组
[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -d /home/mysql -g mysql -m mysql
[root@localhost ~]# passwd mysql

配置环境变量
[root@localhost ~]# su - mysql
[mysql@localhost ~]$ vim .bash_profile 
[mysql@localhost ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/mysql_software_56/bin

export PATH

(4) 创建相关目录
创建软件目录
[root@localhost ~]# mkdir  /mysql_software_56

创建数据文件目录和日志目录
[root@localhost ~]# mkdir -p /my3306/data
[root@localhost ~]# mkdir -p /my3306/log/iblog
[root@localhost ~]# mkdir -p /my3306/log/binlog

创建存放Pid和临时文件目录
[root@localhost ~]# mkdir -p /my3306/run
[root@localhost ~]# mkdir -p /my3306/tmp

更改权限
[root@localhost ~]# chown -R mysql:mysql /my3306
[root@localhost ~]# chmod -R 755 /my3306

(5) 解压MySQL 5.6安装包并安装cmake
[root@localhost ~]# cd /install/
[root@localhost install]# tar xvfz mysql-5.6.37.tar.gz

[root@localhost install]# yum install -y cmake GCc gcc-c++ ncurses-devel zlib libxml openssl

(6) 编译并安装
[root@localhost install]# cd mysql-5.6.37
[root@localhost mysql-5.6.37]# cmake . -DCMAKE_INSTALL_PREFIX=/mysql_software_56 \
> -DINSTALL_DATADIR=/my3306/data \
> -DDEFAULT_CHARSET=utf8 \
> -DDEFAULT_COLLATION=utf8_general_ci \
> -DEXTRA_CHARSETS=all \
> -DWITH_SSL=yes \
> -DWITH_EMBEDDED_SERVER=1 \
> -DWITH_MYISAM_STORAGE_ENGINE=1 \
> -DWITH_INNOBASE_STORAGE_ENGINE=1 \
> -DWITH_FEDERATED_STORAGE_ENGINE=1 \
> -DWITH_ARCHive_STORAGE_ENGINE=1 \
> -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
> -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
> -DWITH_PARTITION_STORAGE_ENGINE=1 \
> -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
> -DMYSQL_UNIX_ADDR=/my3306/run/mysql.sock \
> -DMYSQL_tcp_PORT=3306 \
> -DSYSCONFDIR=/etc \
> -DENABLED_LOCAL_INFILE=ON \
> -DCOMPILATION_COMMENT='MySQL 5.6 production environment' \
> -DWITH_READLINE=ON

[root@localhost mysql-5.6.37]# make
[root@localhost mysql-5.6.37]# make install

(7) 配置MySQL参数文件
[root@localhost tmp]# cat /etc/my_5.6_3306.cnf 
[client]
port=3306
Socket=/my3306/run/mysql.sock

[mysql]
pid_file=/my3306/run/mysqld.pid

[mysqld]
autocommit=1
general_log=off
explicit_defaults_for_timestamp=true

# system
basedir=/mysql_software_56
datadir=/my3306/data
max_allowed_packet=1g
max_connections=3000
max_user_connections=2800
open_files_limit=65535
pid_file=/my3306/run/mysqld.pid
port=3306
server_id=101
skip_name_resolve=ON
socket=/my3306/run/mysql.sock
tmpdir=/my3306/tmp

#binlog
log_bin=/my3306/log/binlog/binlog
binlog_cache_size=32768
binlog_fORMat=row
expire_logs_days=7
log_slave_updates=ON
max_binlog_cache_size=2147483648
max_binlog_size=524288000
sync_binlog=100

#logging
log_error=/my3306/log/error.log
slow_query_log_file=/my3306/log/slow.log
log_queries_not_using_indexes=0
slow_query_log=1
log_slave_updates=ON
log_slow_admin_statements=1
long_query_time=1

#relay
relay_log=/my3306/log/relaylog
relay_log_index=/my3306/log/relay.index
relay_log_info_file=/my3306/log/relay-log.info

#slave
slave_load_tmpdir= /my3306/tmp
slave_skip_errors=OFF

#innodb
innodb_data_home_dir=/my3306/log/iblog
innodb_log_group_home_dir=/my3306/log/iblog
innodb_adaptive_flushing=ON
innodb_adaptive_hash_index=ON
innodb_autoinc_lock_mode=1
innodb_buffer_pool_instances=8

#default
innodb_change_buffering=inserts
innodb_checksums=ON
innodb_buffer_pool_size= 128M
innodb_data_file_path=ibdata1:32M;ibdata2:16M:autoextend
innodb_doublewrite=ON
innodb_file_format=Barracuda
innodb_file_per_table=ON
innodb_flush_log_at_trx_commit=1
innodb_flush_method=O_DIRECT
innodb_io_capacity=1000
innodb_lock_wait_timeout=10
innodb_log_buffer_size=100M
innodb_log_file_size=1048576000
innodb_log_files_in_group=4
innodb_max_dirty_pages_pct=60
innodb_open_files=60000
innodb_purge_threads=1
innodb_read_io_threads=4
innodb_stats_on_metadata=OFF
innodb_support_xa=ON
innodb_use_native_aio=OFF
innodb_write_io_threads=10

[mysqld_safe]
datadir=/my3306/data

(8) 初始化MySQL
[root@localhost mysql_software_56]# /mysql_software_56/scripts/mysql_install_db  --defaults-file=/etc/my_5.6_3306.cnf --datadir=/my3306/data/ --user=mysql
Installing MySQL system tables...2017-07-29 02:01:18 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-07-29 02:01:18 0 [Note] ./bin/mysqld (mysqld 5.6.37-log) starting as process 50198 ...

OK

Filling help tables...2017-07-29 02:03:47 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-07-29 02:03:47 0 [Note] ./bin/mysqld (mysqld 5.6.37-log) starting as process 50239 ...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWord FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /mysql_software_56/bin/mysqladmin -u root password 'new-password'
  /mysql_software_56/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:

  /mysql_software_56/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; /mysql_software_56/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at Http://bugs.mysql.com/

The latest information about MySQL is available on the WEB at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL Server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

启动数据库
[root@localhost mysql_software_56]# /mysql_software_56/bin/mysqld_safe --defaults-file=/etc/my_5.6_3306.cnf --user=mysql &
[1] 50284
[root@localhost mysql_software_56]# 170729 02:07:56 mysqld_safe Logging to '/my3306/log/error.log'.
170729 02:07:56 mysqld_safe Starting mysqld daemon with databases from /my3306/data

到此,相信大家对“MySQL5.6源码编译安装的流程”有了更深的了解,不妨来实际操作一番吧!这里是编程网网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

您可能感兴趣的文档:

--结束END--

本文标题: MySQL5.6源码编译安装的流程

本文链接: https://www.lsjlt.com/news/59919.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • MySQL5.6源码编译安装的流程
    本篇内容主要讲解“MySQL5.6源码编译安装的流程”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“MySQL5.6源码编译安装的流程”吧! ...
    99+
    2022-10-18
  • 红帽mysql5.6源码编译安装过程
    操作系统more /etc/centos-release CentOS release 6.8 (Final)mysql5.6.44版本获取https://dev.mysql.com/get/Downloa...
    99+
    2022-10-18
  • 如何进行Mysql5.6或Centos6.5源码编译安装
    这篇文章给大家介绍如何进行Mysql5.6或Centos6.5源码编译安装,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。## 说明 不同服务器需要改变 server_id ,同一台机器上需要改变 port 关闭防火墙[...
    99+
    2023-06-06
  • MySQL5.7.16源码编译安装的过程
    这篇文章主要讲解了“MySQL5.7.16源码编译安装的过程”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“MySQL5.7.16源码编译安装的过程”吧!安装...
    99+
    2022-10-18
  • PHP源码编译安装
    目录 编译环境编译过程运行配置运行环境1. 创建php.ini文件2. 创建 php-fpm.conf文件3. 创建 www.conf文件4. 配置连接socket为文件(可选)5. 配置ng...
    99+
    2023-09-21
    php sqlite ubuntu
  • 源码编译安装mysql5.7.18
    #yum install -y gcc-c++ cmake vim ncurses-devel wget#useradd mysql -s /home/nologin#mkdir /soft/my...
    99+
    2022-10-18
  • MySQL源码编译安装
    1、安装cmake-2.8.10.2.tar.gz以root用户进入shell#tar -zxvf  cmake-2.8.10.2.tar.gz#cd cmake-2.8.10.2#./confi...
    99+
    2022-10-18
  • 源码编译安装MySQL8.0.20
    2 源码编译安装的相关知识 2.1 make与configure make是一个编译的命令,会在当前的目录下寻找Makefile这个文件,Makefile文件记录了源代码如何编译的详细信息。而configure是由软件开发商编写的一个检测程...
    99+
    2017-08-02
    源码编译安装MySQL8.0.20
  • MySQL5.7.26 源码编译安装
    1.安装依赖组件yum -y install gcc gcc-c++ pcre pcre-devel openssl openssl-devel yum -y install zlib zlib-devel...
    99+
    2022-10-18
  • 源码编译安装MySQL 5.7.9的过程
    这篇文章主要介绍“源码编译安装MySQL 5.7.9的过程”,在日常操作中,相信很多人在源码编译安装MySQL 5.7.9的过程问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”源码编译安装MySQL 5.7.9...
    99+
    2023-06-01
  • Ubuntu源码编译安装Apache的教程
    这篇文章主要讲解了“Ubuntu源码编译安装Apache的教程”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Ubuntu源码编译安装Apache的教程”吧!apache 安装指南:http:...
    99+
    2023-06-05
  • VS2022编译安装Qt6.5源码教程
    目录一、准备环境二、下载Qt 6.5源码三、解压四、编译、安装一、准备环境 包括安装VS2022,Windows SDK,Python3,这里就不再一一介绍了,需要说明的一点是还需要...
    99+
    2023-05-20
    VS2022编译安装Qt6.5源码 VS2022安装Qt6.5源码
  • 源码编译安装mysql-5.7.14
    1.下载并上传 mysql-5.7.14.tar.gz view plain copytar -zxf msql-5.7.14.tar.gz  2...
    99+
    2022-10-18
  • CentOS 7下源码安装MySQL5.6的过程
    本篇内容介绍了“CentOS 7下源码安装MySQL5.6的过程”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所...
    99+
    2022-10-18
  • Nginx源码编译安装过程记录
    rpm包安装比较简单,这里不做说明。 对于大多数开源软件,如果找不到安装包,可以使用源码安装方式,源码安装虽然没有yum、apt等工具方便,但是非常通用,在不同架构的cpu、不同操作...
    99+
    2022-11-12
  • Vue3 编译流程-源码解析
    前言: Vue3 发布已经很长一段时间了,最近也有机会在公司项目中用上了 Vue3 + TypeScript + Vite 的技术栈,所以闲暇之余抽空也在抽空阅读 Vue3 的源码。...
    99+
    2022-11-12
  • 源码编译安装LAMP环境
    1、请描述一次完整的http请求处理过程;2、httpd所支持的处理模型有哪些,他们的分别使用于哪些环境。3、源码编译安装LAMP环境(基于wordpress程序),并写出详细的安装、配置、测试过程。4、建...
    99+
    2022-10-18
  • 源码编译怎么安装PostgresSQL
    这篇文章主要讲解了“源码编译怎么安装PostgresSQL”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“源码编译怎么安装PostgresSQL”吧!一、环境...
    99+
    2022-10-18
  • 源码编译怎么安装pg11.5
    这篇文章主要介绍“源码编译怎么安装pg11.5”,在日常操作中,相信很多人在源码编译怎么安装pg11.5问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”源码编译怎么安装pg11...
    99+
    2022-10-18
  • 源码如何编译安装MySQL5.6.12
    这篇文章主要为大家展示了“源码如何编译安装MySQL5.6.12”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“源码如何编译安装MySQL5.6.12”这篇文章吧...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作