澳门金沙vipmysql多实例的配置(转)

环境:CentOS6.4+MySQL5.6.39

1、成立多实例的目录:

1、创立多实例的目录:

Case复现:

mkdir -p /data/mysql/mysql_3307/{data,tmp,logs}

mkdir -p /data/mysql/mysql_3307/{data,tmp,logs}

       
 源码安装MySQL5.6.39,不更换配置文件开端化后开发银行mysql,此时劳动平日运营且已产生配置文件/etc/my.cnf,但配备文件中参数项比相当少,手动修改/etc/my.cnf文件如下:

mkdir -p /data/mysql/mysql_3308/{data,tmp,logs}

mkdir -p /data/mysql/mysql_3308/{data,tmp,logs}

[client]

 

 

#password       = your_password

2、修改my.cnf的布署文件

2、修改my.cnf的配备文件

port            = 3306

vi /data/mysql/mysql_3306/my3306.cnf

vi /data/mysql/mysql_3306/my3306.cnf 

socket          = /opt/mysql/databases/mysql.sock

#my.cnf

#my.cnf

[mysqld]

[client]

[client]

port            = 3306

port = 3306

port            = 3306

socket          = /opt/mysql/databases/mysql.sock

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

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

skip-external-locking

 

 

skip_name_resolve

[mysql]

[mysql]

key_buffer_size = 32M

prompt=[3306]>

prompt=[3306]>

max_allowed_packet = 32M

#tee=/data/mysql/mysql_3306/data/query.log

#tee=/data/mysql/mysql_3306/data/query.log

table_open_cache = 1024

no-auto-rehash

no-auto-rehash

sort_buffer_size = 4M

 

 

read_buffer_size = 8M

[mysqld]

[mysqld]

read_rnd_buffer_size = 4M

user = mysql

user = mysql

myisam_sort_buffer_size = 64M

basedir = /usr/local/mysql

basedir = /usr/local/mysql

bulk_insert_buffer_size = 64M

datadir = /data/mysql/mysql_3306/data

datadir =
/data/mysql/mysql_3306/data

tmp_table_size = 32M

port = 3306

port = 3306

max_heap_table_size = 32M

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

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

thread_cache_size = 1000

event_scheduler = 0

event_scheduler = 0

query_cache_size = 0

tmpdir = /data/mysql/mysql_3306/tmp

tmpdir =
/data/mysql/mysql_3306/tmp

query_cache_type = 0

 

 

max_connections=1000

 

 

max_connect_errors = 1000000

 

 

sync_binlog = 100

#timeout

#timeout

long_query_time = 2

interactive_timeout = 300

interactive_timeout = 300

slow_query_log_file =
/opt/mysql/databases/mysql-slow_3306.log  #该参数与5.5本子有分别

wait_timeout = 300

wait_timeout = 300

datadir = /opt/mysql/databases

 

 

log_error=/opt/mysql/databases/error.log

#character set

#character set

pid-file=/opt/mysql/databases/mysql.pid

character-set-server = utf8

character-set-server = utf8

log-bin=mysql-bin

 

 

binlog_format=rows

#open_files_limit = 65535

#open_files_limit = 65535

server-id       = 1

max_connections = 100

max_connections = 100

innodb_write_io_threads = 8

max_connect_errors = 100000

max_connect_errors = 100000

innodb_read_io_threads = 8

 

 

innodb_open_files = 65535

skip-name-resolve = 1

skip-name-resolve = 1

innodb_flush_method = O_DIRECT

#logs

#logs

innodb_max_dirty_pages_pct=50

log-output=file

log-output=file

innodb_file_per_table = 1

slow_query_log = 1

slow_query_log = 1

innodb_flush_log_at_trx_commit=2

slow_query_log_file = slow.log

slow_query_log_file = slow.log

innodb_log_buffer_size = 32M

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

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

innodb_log_files_in_group = 2

log_warnings = 2

log_warnings = 2

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

pid-file = mysql.pid

pid-file = mysql.pid

下一场再次开动mysql服务报错: E奥迪Q5ROPRADO! The server quit without updating PID
file
(/opt/mysql/databases/mysql.pid). 但mysql错误日志却未曾记录任何错误新闻。

long_query_time = 1

long_query_time = 1

 

#log-slow-admin-statements = 1

#log-slow-admin-statements = 1

化解办法:重新开始化mysql

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

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

cd /opt/mysql/scripts

log-slow-slave-statements = 1

log-slow-slave-statements = 1

./mysql_install_db  –user=mysql –basedir=/opt/mysql
–datadir=/opt/mysql/databases/

 

 

重启mysql服务,运转成功。

 

 

 

 

 

 

#binlog

#binlog

binlog_format = mixed

binlog_format = mixed

server-id = 203306

server-id = 203306

log-bin = /data/mysql/mysql_3306/logs/mybinlog

log-bin =
/data/mysql/mysql_3306/logs/mybinlog

binlog_cache_size = 4M

binlog_cache_size = 4M

max_binlog_size = 1G

max_binlog_size = 1G