下载MySQL5.6

访问MySQL官网

点击Downloads,然后选择Archives

选择MySQL Community Server

选择合适版本和平台

选择下载预先编译好的二进制安装包

将下载好的包转移至linux机器中

# mkdir /opt/mysql/

# cd /opt/mysql/

将下载的安装包放到/opt/mysql/下

解压安装包并创建相关文件夹

# tar zxvf mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz

# cd /usr/local/

# ln -s /opt/mysql/mysql-5.6.23-linux-glibc2.5-x86_64 mysql

# groupadd mysql

# useradd -g mysql -s /sbin/nologin -d /usr/local/mysql mysql

# mkdir /usr/local/mysql/logs

# mv /etc/my.cnf /etc/my.cnf.bak

编辑配置文件

# vim /usr/local/mysql/data/my.cnf

写入以下内容

#my.cnf start

[client]

port = 3306

socket = mysql.sock

[mysql]

#pager="less -i -n -S"

#tee=/home/mysql/query.log

no-auto-rehash

[mysqld_multi]

mysqld = /usr/local/mysql /bin/mysqld_safe

mysqladmin = /usr/local/mysql /bin/mysqladmin

log = /usr/local/mysql/logs/mysqld_multi.log

[mysqld]

#misc

user = mysql

basedir = /usr/local/mysql

datadir = /usr/local/mysql/data/

port = 3306

socket = /tmp/mysql.sock

event_scheduler = 0

#timeout

interactive_timeout = 300

wait_timeout = 300

#character set

character-set-server = utf8

open_files_limit = 65535

max_connections = 100

max_connect_errors = 100000

#logs

log-output=file

slow_query_log = 1

slow_query_log_file = /usr/local/mysql/logs/slow.log

log-error = /usr/local/mysql/logs/error.log

log_warnings = 2

pid-file = /usr/local/mysql/logs/mysql.pid

long_query_time = 1

#log-slow-admin-statements = 1

#log-queries-not-using-indexes = 1

log-slow-slave-statements = 1

#binlog

binlog_format = mixed

server-id = 10518

log-bin = mybinlog

binlog_cache_size = 4M

max_binlog_size = 1G

max_binlog_cache_size = 2G

sync_binlog = 1

expire_logs_days = 10

#relay log

skip_slave_start = 1

max_relay_log_size = 1G

relay_log_purge = 1

relay_log_recovery = 1

log_slave_updates

#slave-skip-errors=1032,1053,1062

#buffers & cache

table_open_cache = 2048

table_definition_cache = 2048

table_open_cache = 2048

max_heap_table_size = 96M

sort_buffer_size = 2M

join_buffer_size = 2M

thread_cache_size = 256

query_cache_size = 0

query_cache_type = 0

query_cache_limit = 256K

query_cache_min_res_unit = 512

thread_stack = 192K

tmp_table_size = 96M

key_buffer_size = 8M

read_buffer_size = 2M

read_rnd_buffer_size = 16M

bulk_insert_buffer_size = 32M

#myisam

myisam_sort_buffer_size = 128M

myisam_max_sort_file_size = 10G

myisam_repair_threads = 1

#innodb

innodb_buffer_pool_size = 1G

innodb_buffer_pool_instances = 1

innodb_data_file_path = ibdata1:1G:autoextend

innodb_flush_log_at_trx_commit = 1

innodb_log_buffer_size = 64M

innodb_log_file_size = 256M

innodb_log_files_in_group = 2

innodb_max_dirty_pages_pct = 50

innodb_file_per_table = 1

innodb_rollback_on_timeout

innodb_status_file = 1

innodb_io_capacity = 2000

transaction_isolation = READ-COMMITTED

innodb_flush_method = O_DIRECT

[mysqld3306]

basedir= /usr/local/mysql

datadir = /usr/local/mysql/data/

innodb_buffer_pool_size = 4G

transaction_isolation = REPEATABLE-READ

########my.cnf配置文件结束#######

安装依赖

# yum install libaio

初始化

# /usr/local/mysql/scripts/mysql_install_db

配置启动脚本

# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/

设置环境变量

# echo "export PATH=$PATH:/usr/local/mysql/bin">>/etc/profile

# source /etc/profile

更改数据库文件夹属主

# chown -R mysql.mysql /usr/local/mysql/

启动数据库

# /etc/init.d/mysql.server start

把mysql变为系统服务

# chkconfig --add mysql.server

# chkconfig mysql.server on

转自

MySQL5.6快速安装 - 今日头条(www.toutiao.com)
http://www.toutiao.com/i6392545735941816834/

MySQL5.6快速安装【转】的更多相关文章

  1. mysql5.6快速安装及参数详解

    一.所需软件 软件名称 版本 下载地址 当前环境 管理员账号/密码 mysql 5.6 yum安装 centOS6.7系统 zxfly/zxfly 二.安装说明 数据库所在目录 /database/m ...

  2. kali2016.2(debian)快速安装mysql5.7.17

    糊里糊涂的删除了kali原本的mysql5.6.27版本,原本的mysql与很多软件关联在一起,每次安装都失败,后来把相关的都卸载了(悲催的浪费了一天) 下载地址  debian mysql下载地址 ...

  3. 二进制方式快速安装MySQL数据库命令集合

    二进制方式快速安装MySQL数据库命令集合 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1.安装mysql ls mysql ...

  4. Centos6.5 安装MYSQL 5.5 -5.6.-5.7 一键yum快速安装 ,初始配置

    Centos6.5 安装MYSQL 5.5 ---5.6---5.7 一键yum快速安装 ,初始配置 第一步:安装mysql-5.5---- 5.6 ---- 5.7的yum源 [root@sv03 ...

  5. centos7.0利用yum快速安装mysql8.0

    我这里直接使用MySQL Yum存储库的方式快速安装: 抽象 MySQL Yum存储库提供用于在Linux平台上安装MySQL服务器,客户端和其他组件的RPM包.这些软件包还可以升级和替换从Linux ...

  6. Mysql5.7.20安装文档

    Mysql5.7.20安装文档 一.Linxu下数据库的恢复和备份 当我们MySQL数据库保存重要数据的时候,备份工作极为重要.本文介绍如何使用mysqldump备份和恢复数据,使用该方法,可以将数据 ...

  7. CocoaPods 的简单快速安装方法

    CocoaPods 的简单快速安装方法(Setting up CocoaPods master repo 卡着不动,是因为淘宝镜像已经不能用了. 一.git clone方法安装cocoapods 镜像 ...

  8. CentOS RDO方式快速安装OpenStack

    一.了解RDO RDO是什么? RDO是红帽Red Hat Enterprise Linux OpenStack Platform的社区版,类似RHEL和Fedora,RHEV和oVirt这样的关系. ...

  9. Linux超快速安装Ruby on Rails

    Linux超快速安装Ruby on Rails 时间 2014-11-25 11:45:11 Flincllck Talk 原文  http://www.flincllck.com/quick-ins ...

随机推荐

  1. 软件工程实践-git的使用

    ² Github使用心得 其实以前就注册过一个github账号,不过那时只不过是因为在网上看到这个挺对于程序员有着重大作用就顺手去弄了,从未使用过,直到这次软工实践需要我才从新回想起来. 之前的几篇随 ...

  2. 从零开始学Kotlin-扩展函数(10)

    从零开始学Kotlin基础篇系列文章 什么是扩展函数 扩展函数数是指在一个类上增加一种新的行为,我们甚至没有这个类代码的访问权限: Kotlin 可以对一个类的属性和方法进行扩展,且不需要继承或使用 ...

  3. 原生 JS 中 延迟脚本和异步脚本

    一.延迟脚本 defer HTML4.0中为<script> 标签添加了个defer属性.属性的用途是表民脚本在执行时不会影响页面的构造. 脚本会被延迟到页面加载完毕的时候,执行.也就是当 ...

  4. [Java]Object有哪些公用方法?

    1.clone方法 保护方法,实现对象的浅复制,只有实现了Cloneable接口才可以调用该方法,否则抛出CloneNotSupportedException异常. 主要是JAVA里除了8种基本类型传 ...

  5. composer 使用(踩坑笔记)

    composer的介绍 来张图就好啦!我不细说啦 安装composer 1).PHP 环境变量配置,可参考百度经验: 2).详情可参考中国全量镜像进行 Composer 的安装 3).安装完成后,命令 ...

  6. 【luogu3768】简单的数学题 欧拉函数(欧拉反演)+杜教筛

    题目描述 给出 $n$ 和 $p$ ,求 $(\sum\limits_{i=1}^n\sum\limits_{j=1}^nij\gcd(i,j))\mod p$ . $n\le 10^{10}$ . ...

  7. idea和eclipse的区别

    使用基于IntelliJ的IDE,都会对project和module的关系比较糊涂.用简单的一句话来概括是: IntelliJ系中的Project相当于Eclipse系中的workspace.Inte ...

  8. CRM 报表导出excel时指定sheet名

    如图所示,设置PageName即可: 这样导出excel时,sheet的名就有了:

  9. luogu1373 小a和uim之大逃离 (dp)

    直接设f[i][j][k][l][2]是在(i,j)时两人分数是k,l,复杂度会爆掉 但其实只需要知道两人分数只差就行了 所以设f[i][j][k][2],k是分数之差%(K+1),最后一位表示该谁走 ...

  10. Docker镜像加速==》阿里云加速器

    1.使用阿里云加速器加快获取docker官方的镜像 步骤一:如果没有阿里云账号,需要注册阿里云开发账号 https://dev.aliyun.com/ 步骤二:进入加速器页面获取加速信息 https: ...