MySQL二进制包安装简略过程

l  软件目录

[[email protected]_03 ~]# mkdir -pv /data/software

[[email protected]_03 ~]# cd /data/software/

[[email protected]_03 mysql-5.6.28-linux-glibc2.5-x86_64]# tar xvf mysql-5.6.28-linux-glibc2.5-x86_64.tar.gz

l  软件下载

[[email protected]_03 software]# wget http://120.198.244.50:9999/cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.28-linux-glibc2.5-x86_64.tar.gz

l  安装过程

[[email protected]_03 ~]# groupadd mysql

[[email protected]_03 ~]# useradd -g mysql -d /usr/local/mysql -s /sbin/nologin mysql

[[email protected]_03 data]# mkdir -pv /opt/app/mysql

[[email protected]_03 ~]# chown -R mysql.mysql /usr/local/mysql/

[[email protected]_03 data]# chown -R mysql.mysql /opt/app/mysql/

[[email protected]_03 data]# mkdir -pv /data/3306/{tmp,logs,data}

[[email protected]_03 ~]# chown -R mysql.mysql /data/mysql

[[email protected]_03 ~]# cd /data/software/

[[email protected]_03 ~]# mv mysql-5.6.28-linux-glibc2.5-x86_64/* /opt/app/mysql/

[[email protected]_03 ~]# cd /opt/app/mysql/

[[email protected]_03 mysql]# ./scripts/mysql_install_db --basedir=/opt/app/mysql --datadir=/data/3306/data --user=mysql

[[email protected]_03 mysql]# cp support-files/mysql.server /etc/init.d/mysqld

[[email protected]_03 mysql]# chmod +x /etc/init.d/mysqld

=============================my.cnf的配置=========================================================

[client]

port = 3306

socket      = /data/3306/tmp/mysql.sock

# The MySQL server

[mysqld]

###base

explicit_defaults_for_timestamp=true

port = 3306

user            = mysql

basedir     = /opt/app/mysql

datadir     = /data/3306/data

pid-file      = /data/3306/tmp/mysql.pid

socket      = /data/3306/tmp/mysql.sock

character_set_server = utf8

tmpdir = /dev/shm

server-id = 033306

skip_name_resolve = 1

skip_external_locking = 1

lower_case_table_names = 1

# logs

long_query_time     = 1

slow_query_log = 1

slow_query_log_file = /data/3306/logs/slow.log

log_error = /data/3306/logs/error.log

# binlog

binlog_format = row

log_bin     = /data/3306/logs/mysql-bin

binlog_cache_size = 8M

max_binlog_size = 1G

max_binlog_cache_size = 4G

expire_logs_days = 5

log_bin_trust_function_creators = 1

############ myisam

key_buffer_size = 64M

#bulk_insert_buffer_size = 32M

########## PGA

sort_buffer_size = 8M

read_buffer_size = 8M

join_buffer_size = 32M

read_rnd_buffer_size = 32M

query_cache_type = 0

query_cache_size = 0M

table_open_cache = 6144

table_definition_cache = 4096

open_files_limit = 65536

back_log = 512

max_connections = 1100

max_user_connections = 1000

max_connect_errors = 10000

max_allowed_packet = 128M

thread_cache_size = 64

thread_stack=192k

tmp_table_size=128M

max_heap_table_size=128M

# InnoDB

transaction_isolation = READ-COMMITTED

innodb_data_home_dir = /data/3306/data

innodb_log_group_home_dir = /data/3306/data

innodb_data_file_path = ibdata1:1G:autoextend

innodb_buffer_pool_size = 1G

innodb_buffer_pool_instances    = 8

#innodb_additional_mem_pool_size = 16M

innodb_log_file_size = 1024M

innodb_log_buffer_size = 64M

innodb_log_files_in_group = 3

innodb_flush_log_at_trx_commit = 1

innodb_lock_wait_timeout = 10

innodb_sync_spin_loops = 40

innodb_max_dirty_pages_pct = 80

innodb_thread_concurrency = 0

innodb_thread_sleep_delay = 500

innodb_concurrency_tickets = 1000

innodb_flush_method = O_DIRECT

innodb_file_per_table = 1

innodb_read_io_threads = 20

innodb_write_io_threads = 20

innodb_io_capacity = 600

innodb_file_format = Barracuda

innodb_purge_threads=1

innodb_purge_batch_size = 32

innodb_old_blocks_pct=50

innodb_stats_on_metadata=0

#

optimizer_switch=‘mrr=on,mrr_cost_based=off,batched_key_access=on‘

# wait

#wait_timeout = 28800

#interactive_timeout = 120

#connect_timeout = 20

#slave-net-timeout = 30

[mysqldump]

quick

max_allowed_packet = 128M

#myisam_max_sort_file_size = 10G

[mysql]

no-auto-rehash

max_allowed_packet = 128M

default_character_set          = utf8

[myisamchk]

key_buffer_size = 64M

sort_buffer_size = 512k

read_buffer = 2M

write_buffer = 2M

[mysqlhotcopy]

interactive-timeout

==================================/etc/init.d/mysqld中需要修改的2个地方=====================================

basedir=/opt/app/mysql

datadir=/data/3306/data

时间: 2024-10-28 22:44:41

MySQL二进制包安装简略过程的相关文章

MySQL二进制包安装并自定义basedir

前言: MySQL二进制包,定死了basedir为/usr/local/mysql/,但是很多人喜欢自定义目录,比如我就喜欢放/opt/app/mysql 数据目录喜欢自定义为/data/mydata/,以前必须把basedir必须做个软链接到/usr/local/mysql,本人有轻微的强迫症,就不想这么做,下面就来看实现过程. 1创建组,创建用户 groupadd -g3306 mysql useradd -u3306 -M -s /sbin/nologin mysql 2.解压二进制包,创

mysql二进制包安装与配置实战记录

导读 一般中小型网站的开发都选择 MySQL 作为网站数据库,由于其社区版的性能卓越,搭配 PHP .Linux和 Apache 可组成良好的开发环境,经过多年的web技术发展,在业内被广泛使用的一种web服务器解决方案之一.但是mysql源码包编译时间过长,今天将采用二进制包方式安装mysql,并进行优化配置,希望对广大读者有借鉴意义. 1.安装之前,先创建mysql用户 [[email protected]_nfs ~]# useradd mysql -s /sbin/nologin -M

ubuntu下mysql二进制包安装

1.下载对应二进制包 cd /usr/local/srcsudo wget http://dev.mysql.com/downloads/file/?id=465030 2.解压并放在/usr/local目录下改名为mysql sudo tar zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gzsudo mv mysql-5.6.33-linux-glibc2.5-x86_64 /usr/local/mysql 3.创建mysql分组和用户,更改mysq

MySQL二进制包安装脚本及批量安装

#!/bin/bash ###需要部署数据库的IP列表####ip192.168.1.10#ip192.168.1.11#ip192.168.1.12#ip192.168.1.13#ip192.168.1.14#ip192.168.1.15 ######执行脚本前,请确认已通外网,YUM源可用####cd /rootmyb=mysql-5.6.24-linux-glibc2.5-x86_64.tar.gzml=`echo $myb|cut -d"t" -f1|cut -d".

mysql二进制包安装

./bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql57/ --datadir=/mysqldata ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ ./bin/mysqld --initialize --datadir=/mysqldata dadlI<t(k1Ek 首次安

MySQL二进制包安装实例 ( 5.5 、5.6 共存 )

mysql5.5版本和5.6版本在同一服务器上开启实例,在日常工作中都会碰到,开启多版本需要注意: 1.启动初始化不能用ln -s链接的名字来初始化 2.启动需要加--ledir=basedir 3.启动填写参数的位置 在这之前,一直使用ln -s 来启动5.6 一直报错: 在这之前看着启动没错吧: 然而显示的 unknown variable 'defaults-file=/etc/my3309.cnf' 同时根据配置文件的配置信息error的路径也不对,会默认到/var/log/mysql.

二进制包安装MySQL数据库

1.1二进制包安装MySQL数据库 1.1.1 安装前准备(规范) [[email protected]_server ~]# mkdir -p /home/shangbao_zhangdc/tools  ##创建指定工具包存放路径[[email protected]_server ~]# wget http://ftp.ntu.edu.tw/pub/MySQL/Downloads/MySQL-5.5/mysql-5.5.32-linux2.6-x86_64.tar.gz  ##下二进制包,这个

shell安装MySQL二进制包

现在解压MySQL二进制包,稍作配置,就能用了,安装速度快,安装来练习最好不过了,哈哈 该脚本只是安装二进制的MySQL包,my.cnf只修改了简单的选项,没有过多进行设置,若朋友们用我的脚本安装作为线上环境,需要在变量处修改为自己想要的内容即可,my.cnf你们要根据自己生产环境情况进行配置,安装包自己从官网下载,现在好像过墙才能下载了 官网:http://dev.mysql.com/downloads/mysql/ #!/bin/bash #-------------------------

mysql 5.7.14二进制包安装

操作系统版本: [[email protected] ~]# cat /etc/redhat-release CentOS release 6.5 (Final) 操作系统内核: [[email protected] ~]# uname -r 2.6.32-431.el6.x86_64 关闭防火墙并关闭自启动: [[email protected] ~]# /etc/init.d/iptables stop [[email protected] ~]# chkconfig --level 234