mysql5.6.20二进制安装

1把105的/usr/local/mysql拷过去

2. 把105的/etc/my.cnf拷过去

3. mkdir /data/mysql/{data,tmp,binlog,log}-p

4. 初始化

rpm -qa mysql

yum remove mysql-5.1.73-8.el6_8.x86_64

/etc/my.cnf /etc/my.cnf.bak

yum install libaio*

useradd mysql

mkdir /data/mysql/{data,tmp,binlog,log} -p

chown -R mysql.mysql /data/mysql

tar xf/tmp/mysql-5.6.20-linux-glibc2.5-x86_64.tar.gz -C /usr/local/

cd /usr/local/

mv mysql-5.6.20-linux-glibc2.5-x86_64 mysql

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

cd /usr/local/mysql/scripts

./mysql_install_db --datadir=/data/mysql/data--basedir=/usr/local/mysql --user=mysql --explicit_defaults_for_timestamp

echo "/usr/local/mysql/lib" >/etc/ld.so.conf.d/mysql.conf && ldconfig -v

ln -s /usr/local/mysql/include /usr/include/mysql

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

chkconfig mysqld on

echo "exportPATH=$PATH:/usr/local/mysql/bin" > /etc/profile.d/mysql.sh

source /etc/profile

/etc/init.d/mysqld restart

ps -ef|grep mysql

mysqladmin -uroot password ‘Z2323445‘ -S  /data/mysql/mysqld.sock

mysql -uroot -p -S /data/mysql/mysqld.sock

mysql初步优化:

drop database test;drop user [email protected]‘::1‘;drop user‘‘@‘localhost‘;drop user ‘‘@‘localhost.localdomain‘;drop user ‘root‘@‘localhost.localdomain‘;select user,host from mysql.user; flush privileges;

以及添加天兔lepus监控mysql

grant insert,update,delete,create,select,super,process,reload,showdatabases,replication client on *.* to‘lepus_monitor‘@‘221.203.45.78‘ identified by ‘[email protected]@MoniTOR‘; flush privileges;

mysql5.6.20 my.cnf配置文件

服务器环境为dellr710服务器,内存:60G,cpu是超线程

[mysqld]

back_log = 2000

basedir = /usr/local/mysql

binlog-format = MIXED

character_set_server = utf8

datadir = /data/mysql/data

event_scheduler = ON

expire_logs_days = 1

innodb_autoinc_lock_mode = 1

innodb_buffer_pool_size = 1073741824

innodb_data_file_path = ibdata1:500M:autoextend

innodb_data_home_dir = /data/mysql/data

innodb_file_per_table = 1

innodb_flush_log_at_trx_commit = 2

innodb_flush_method = O_DIRECT

innodb_io_capacity = 2000

innodb_log_buffer_size = 8388608

innodb_log_files_in_group = 3

innodb_log_group_home_dir = /data/mysql/data

innodb_max_dirty_pages_pct = 50

innodb_open_files = 1024

innodb_read_io_threads = 8

innodb_thread_concurrency = 20

innodb_write_io_threads = 8

innodb_lock_wait_timeout = 10

innodb_buffer_pool_load_at_startup = 1

innodb_buffer_pool_dump_at_shutdown = 1

key_buffer_size = 3221225472

innodb_log_file_size = 1G

local_infile = 1

log-bin = /data/mysql/binlog/mysql-bin.log

log_bin_trust_function_creators = 1

log_output = FILE

long_query_time = 1

log-error = /data/mysql/log/error.log

max_allowed_packet = 33554432

max_connect_errors = 1000000

max_connections = 2000

myisam_sort_buffer_size = 33554432

myisam_recover = 1

join_buffer_size = 8388608

tmp_table_size = 33554432

net_buffer_length = 8192

performance_schema = 1

performance_schema_max_table_instances = 200

pid-file = /data/mysql/mysqld.pid

port = 3306

query_cache_size = 0

query_cache_type = 0

read_buffer_size = 20971520

read_rnd_buffer_size = 16M

max_heap_table_size = 33554432

bulk_insert_buffer_size = 134217728

#relay-log = /data/mysql/log/mysql-relay.log

secure-file-priv = /data/mysql/tmp

server-id = 1131053306

skip-slave-start

skip_name_resolve

slave-load-tmpdir = /data/mysql/tmp

slow-query-log-file = /data/mysql/log/mysql-slow.log

slow_query_log = 1

socket = /data/mysql/mysqld.sock

sort_buffer_size = 2097152

sync_binlog = 1

table_open_cache = 128

thread_cache_size = 50

tmpdir = /data/mysql/tmp

user = mysql

wait_timeout = 120

transaction_isolation=read-committed

long_query_time=1

sync_binlog=0

innodb_flush_log_at_trx_commit=0

[mysqld_safe]

log-error = /data/mysql/log/error.log

pid-file = /data/mysql/mysqld.pid

时间: 2024-11-25 15:44:16

mysql5.6.20二进制安装的相关文章

mysql5.6.20二进制安装部署文档

一.业务需求: 单台服务器线上运行着mysql5.5.48 现在是不影响线上的业务,不停止线上的mysql5.5数据库来部署另外一个mysql5.6.20的实例 二.安装部署过程: 2.1安装部署过程注意事项: 在初始化mysql数据库时,是会寻找my.cnf配置文件的,是有顺序的,默认的顺序是: [[email protected] ~]# mysql --help | grep 'Default options' -A 1 Default options are read from the

mysql-5.7.20 二进制安装 | 备份恢复

###### 二进制自动安装数据库脚本root密码123456将脚本和安装包放在/usr/local/src目录即可############### ######数据库目录/usr/local/mysql############ ######数据目录/data/mysql############ ######慢日志目录/data/slowlog############ ######端口号默认3306其余参数按需自行修改############ #!/bin/bash cd /usr/local/s

mysql5.6 通用二进制安装

mysql5.6 通用二进制安装: #卸载原有的mysqlyum remove mysql*ls /etc/my.cnf*mv /etc/my.cnf* /tmp/ #安装依赖包yum install make cmake gcc gcc-c++ bison-devel ncurses-devel autoconf automake -y #添加用户groupadd mysqluseradd -r -g mysql mysql#useradd -M -s /sbin/nologin mysql

centos6.5下mysql5.6.20编译安装实验

先去官方下载mysql5.6.20源码包,然后yum -y install gcc gcc-devel gcc-c++ gcc-c++-devel autoconf* automake* zlib* libxml* ncurses-devel ncurses libgcrypt* libtool* cmake openssl openssl-devel bison bison-devel 准备编译需要用到的组件. 创建mysql用户和组 groupadd mysql useradd -g mys

mysql-5.6.x和mysql-5.7.x二进制安装

#!/bin/bash #__Author__:Allen_Jol at 2018-03-21 13:52:13 #Description: install mysql-5.6.39 or mysql-5.7.21 binary for centos 6.x CPUINFO=`cat /proc/cpuinfo | grep -c  processor` DIR="/usr/local/src" MDIR="/usr/local/mysql" DATADIR=&qu

mysql5.5.60二进制安装

系统centos6.8安装过程如下: mkdir -p /home/mysql3307/{data,log,binlog,tmp} useradd mysql -S /sbin/nologin -M chown -R mysql.mysql /home/mysql3307/{data,log,binlog,tmp} wget http://ftp.kaist.ac.kr/mysql/Downloads/MySQL-5.5/mysql-5.5.60-linux-glibc2.12-x86_64.t

Centos7 MYSQL5.6.42二进制安装

1. 下载二进制mysql的安装包 [root@minion-1 ~]#wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.42-linux-glibc2.12-x86_64.tar.gz 2. 新建一个专放软件的目录 [root@minion-1 ~]#mkdir -p /services/current_apps 3. 解压包到放软件的目录下 [root@minion-1 ~]# tar -xzf mysql-5.6.42-linux

Centos7 Mysql5.7.27二进制安装

步骤一:下载安装包,打开Mysql官网,找到对应的 下载路径如下:https://downloads.mysql.com/archives/community/ wget https://downloads.mysql.com/archives/get/file/mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz -O /usr/local/src/mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz 步骤二:下载依赖包,Cent

mysql-5.7.21 二进制安装 | Jemalloc内存优化 | 备份恢复|修改密码

简介 ######数据库目录/usr/local/mysql############ ######数据目录/data/mysql############ ######慢日志目录/data/slowlog############ ######端口号默认3306其余参数按需自行修改############ 安装脚本 #!/bin/bash cd /usr/local/src/ if [ ! -f mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz ]; then w