一、安装环境

1. 操作系统:CentOS 6.7 x86_64

# yum install make cmake gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel patch wget libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel unzip tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel pspell-devel unzip libcap diffutils net-tools libc-client-devel psmisc libXpm-devel git-core c-ares-devel perl

2. cmake采用yum方式已安装,不需要再安装。

3. MySQL版本:mysql-5.6.29.tar.gz

4. 同样安装方式也适用于mysql-5.5.x.tar.gz

二、安装mysql-5.6.29.tar.gz

1. 下载编译版本mysql安装

tar zxvf mysql-5.6.29.tar.gz

cd mysql-5.6.29

patch -p1 < ../mysql-openssl.patch

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_FAST_MUTEXES=1 -DWITH_DEBUG=0

make && make install

注:重新编驻译采用如下方式,ssl方式不需要采用,可以删除掉相关参数。

make clean

rm -f CMakeCache.txt

2. 准备mysql用户

groupadd mysql

useradd -g mysql -M -s /sbin/nologin mysql

3. 初始化mysql,数据库位置采用默认位置

chown -R mysql:mysql /usr/local/mysql

/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

4. mysql服务配置

cd /usr/local/mysql

cp support-files/my-medium.cnf /etc/my.cnf

cp support-files/mysql.server  /etc/rc.d/init.d/mysqld

chkconfig --add mysqld

chkconfig mysqld on

5. 配置Mysql命令链接

ln -sf /usr/local/mysql/bin/mysql /usr/bin/mysql

ln -sf /usr/local/mysql/bin/mysqldump /usr/bin/mysqldump

ln -sf /usr/local/mysql/bin/myisamchk /usr/bin/myisamchk

ln -sf /usr/local/mysql/bin/mysqld_safe /usr/bin/mysqld_safe

或通过加入环境变量中解决。

# vi /etc/profile

export PATH=/usr/local/mysql/bin/:$PATH

# source /etc/profile

6. 配置其它

ln -sv /usr/local/mysql/include  /usr/include/mysql

echo '/usr/local/mysql/lib' > /etc/ld.so.conf.d/mysql.conf

ldconfig

7. Mysql配置文件

vi /etc/my.cnf

[client]

port        = 3306

socket      = /tmp/mysql.sock

# The MySQL server

[mysqld]

port        = 3306

socket      = /tmp/mysql.sock

datadir = /usr/local/mysql/data

skip-external-locking

max_connections = 1000

key_buffer_size = 16M

max_allowed_packet = 1M

table_open_cache = 64

sort_buffer_size = 512K

net_buffer_length = 8K

read_buffer_size = 256K

read_rnd_buffer_size = 512K

myisam_sort_buffer_size = 8M

#skip-networking

log-bin=mysql-bin

binlog_format=mixed

server-id   = 1

innodb_data_home_dir = /usr/local/mysql/data

innodb_data_file_path = ibdata1:10M:autoextend

innodb_log_group_home_dir = /usr/local/mysql/data

innodb_buffer_pool_size = 16M

innodb_additional_mem_pool_size = 2M

innodb_log_file_size = 5M

innodb_log_buffer_size = 8M

innodb_flush_log_at_trx_commit = 1

innodb_lock_wait_timeout = 50

[mysqldump]

quick

max_allowed_packet = 16M

[mysql]

no-auto-rehash

[myisamchk]

key_buffer_size = 20M

sort_buffer_size = 20M

read_buffer = 2M

write_buffer = 2M

[mysqlhotcopy]

interactive-timeout

expire_logs_days = 10

8. 启动mysql

service mysqld start

9. 修改管理员密码并测试

# /usr/local/mysql/bin/mysqladmin -u root password 'admin' #设置管理员密码

# /usr/local/mysql/bin/mysql -u root -p   #测试密码输入

10. 配置mysql帐号安全

[root@test ~]# /usr/local/mysql/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current

password for the root user.  If you've just installed MySQL, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n

... skipping.

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? [Y/n] 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? [Y/n] 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? [Y/n] 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? [Y/n] y

... Success!

All done!  If you've completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!

Cleaning up...

登录测试:

[root@test data]# mysql -uroot -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 9

Server version: 5.6.29-log Source distribution

Copyright (c) 2000, 2016, 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> \s

--------------

mysql  Ver 14.14 Distrib 5.6.29, for Linux (x86_64) using  EditLine wrapper

Connection id:          9

Current database:

Current user:           root@localhost

SSL:                    Not in use

Current pager:          stdout

Using outfile:          ''

Using delimiter:        ;

Server version:         5.6.29-log Source distribution

Protocol version:       10

Connection:             Localhost via UNIX socket

Server characterset:    utf8

Db     characterset:    utf8

Client characterset:    utf8

Conn.  characterset:    utf8

UNIX socket:            /tmp/mysql.sock

Uptime:                 9 min 36 sec

Threads: 1  Questions: 29  Slow queries: 0  Opens: 71  Flush tables: 1  Open tables: 64  Queries per second avg: 0.050

--------------

mysql>

安装完毕。

mysql 5.6.29编译安装_MySQL-5.6.29源码编译安装记录相关推荐

  1. mysql5.7.13编译安装_MySQL 5.7.13 源码编译安装配置方法图文教程

    安装环境:centos7 64位 mini版 官网源码编译安装文档: 一.系统安装条件 官方文档说明: 1> cmake mysql使用cmake跨平台工具预编译源码,用于设置mysql的编译参 ...

  2. PostgreSql | 数据库 | pg数据库的全安装教程(yum,二进制,源码编译)

                                                       PostgreSql的全安装教程(yum,二进制,源码编译) PostgreSql一般简称为pg, ...

  3. centos lnmp源码安装mysql_CentOS 6.6 下源码编译安装MySQL 5.7.5

    说明:CentOS 6.6 下源码编译安装MySQL 5.7.5 1. 安装相关工具 # yum -y install gcc-c++ ncurses-devel cmake make perl \ ...

  4. Linux系统中软件的“四”种安装原理详解:源码包安装、RPM二进制安装、YUM在线安装、脚本安装包...

    一.Linux软件包分类 1.1 源码包 优点: 开源,如果有足够的能力,可以修改源代码: 可以自由选择所需的功能: 软件是编译安装,所以更加适合自己的系统,更加稳定.效率更高: 卸载方便: 缺点: ...

  5. android编译.a文件,Android 7.1源码编译导入AS完整教程

    本教程仅针对Android 7.1系统,为便于虚拟机备份和出现问题时的还原,本教程分为3步:初始化编译环境.源码同步.编译源码导入Android Studio. 编译源码:Android7.1.2_r ...

  6. ubuntu 编译php5.6,Ubuntu 16.04 源码编译 PHP5.6

    源码编译PHP5.6 //更新依赖 sudo apt-get update sudo apt-get install build-essential //安装依赖 sudo apt-get insta ...

  7. 源码编译Ros, Ubuntu18.04系统使用源码编译Ros1,出错集合及其解决办法

    官方的介绍http://wiki.ros.org/kinetic/Installation中提到了,脚本安装的方法it is available for Ubuntu Wily (15.10) and ...

  8. linux软件安装——rpm、yum、源码包安装

    一.软件包分类 源码包(原始的c语言文件,开源) 二进制包(系统默认包,将源码编译为机器语言,省略了编译过程,安装较快,但是用户看不到源码,安装有依赖性,centos中都是rpm包) 二.rpm命令管 ...

  9. 从桌面下载源码包到linux,Ubuntu kylin安装微信客户端过程(源码包安装方法)

    Ubuntu kylin 17.10系统自带的微信客户端不能使用,删除后重新用源码包安装就可以使用了.本文最后的相关主题采用的方法是通过Snap在Ubuntu中安装微信,源码包安装详细过程如下: 1. ...

  10. centos6.8安装php7.3,CentOS7.6源码编译安装PHP 7.3.8

    安装步骤 1. 使用wget命令下载源码安装包 wget https://www.php.net/distributions/php-7.3.8.tar.gz --no-check-certifica ...

最新文章

  1. VC的文件路径为什么要用双斜杠
  2. 泛型(模拟list)
  3. 一文纵览EMAS 到底内含多少阿里核心技术能力
  4. java读写文件总结
  5. I00003 贝尔三角形
  6. hmcl启动器java下载_我的世界hmcl启动器
  7. Unity 内置渲染管线、SRP、URP、HDRP区别
  8. 湖北省金税盘服务器链接网站,湖北省网上税务局入口:https://wsswj.hb-n-tax.gov.cn...
  9. ArcGIS教程 - 1 绪论
  10. 万年历黄历星座查询v3.6.9引流吸粉 实用工具 流量变现小程序
  11. ionic 应用在iOS上打开相机拍照闪退、百度地图/高德地图定位失败(解决方案)
  12. 文件集群服务器怎么搭建,一台云服务器怎么搭建集群
  13. 移动端草海的渲染方案(一)
  14. # Linux shell终端设置代理服务器的方法
  15. 宽带隙器件增强电机控制设计
  16. android手机配什么蓝牙耳机,安卓手机配什么蓝牙耳机好?安卓系统蓝牙耳机推荐!...
  17. 什么是顶级域名?如何获得顶级域名解析方案
  18. ISP(图像信号处理)学习笔记-帧内预测组合(视频编码入门)
  19. 目标客户画像_什么是客户画像
  20. 实战:怎么比较暂存区和HEAD所含文件的差异?-2021.11.19

热门文章

  1. node2vec文献出处_详解Node2vec以及优缺点
  2. 二年级上册计算题_小学二年级数学上册应用题与思维训练集锦500题
  3. 一次mysql数据库连接池泄露的解决经历
  4. 十四、H.264的变换编码(一)——矩阵运算与正交变换基本概念
  5. linux 命令博客,Linux 命令
  6. oracle数据库详细性能参数,ORACLE数据库性能参数的优化
  7. directshow怎样打开摄像头不预览只抓帧_不比不知道,一比还真有差距!四款高性价比家庭智能摄像头对比...
  8. 用python3做学生管理系统_详解用python实现基本的学生管理系统(文件存储版)(python3)...
  9. java常量信用_JAVA常量
  10. java tcp read_【Java TCP/IP Socket】TCP Socket通信中由read返回值造成的的死锁问题(含代码)(转)...