Mysql 5.6 multi instances configuration on redhat 6.2
Mysql 5.6 multi instances configuration on redhat 6.2
1.create mysql user
/usr/sbin/groupadd -g 601 mysql
/usr/sbin/useradd -u 701 -g mysql mysql
2.create data directory and permissions and attributes
mkdir -p /mysql/data/3307/{data,binlog,tmp}
mkdir -p /mysql/data/3308/{data,binlog,tmp}
mkdir -p /mysql/data/3309/{data,binlog,tmp}
chmod 755 /mysql/data/
chown -R mysql:mysql /mysql/data/
[root@dbdou01 ~]# ls -l /mysql/data/
total 12
drwxr-xr-x. 5 mysql mysql 4096 Jun 23 10:48 3307
drwxr-xr-x. 5 mysql mysql 4096 Jun 23 10:48 3308
drwxr-xr-x. 5 mysql mysql 4096 Jun 23 10:48 3309
3.create {3307,3308,3309} my.cnf
vi /mysql/data/3307/my.cnf
點選( 此處 )摺疊或開啟
-
[
client
]
-
#password
=
mysql123
-
port
=
3307
-
socket
=
/
mysql
/
data
/
3307
/
mysql
.
sock
-
default
-
character
-
set
=
utf8
-
# Here follows entries
for
some specific programs
-
-
# The MySQL
server
-
[
mysqld
]
-
ignore
-
db
-
dir
=
lost
+
found
-
federated
-
character
-
set
-
server
=
utf8
-
collation
-
server
=
utf8_bin
-
port
=
3307
-
socket
=
/
mysql
/
data
/
3307
/
mysql
.
sock
-
datadir
=
/
mysql
/
data
/
3307
-
skip
-
external
-
locking
-
lower
-
case
-
table
-
names
=
1
-
#MYISAM
-
max_connections
=
2048
-
key_buffer_size
=
512M
-
max_allowed_packet
=
16M
-
table_open_cache
=
2048
-
sort_buffer_size
=
8M
-
net_buffer_length
=
512K
-
read_buffer_size
=
8M
-
read_rnd_buffer_size
=
16M
-
myisam_sort_buffer_size
=
256M
-
query_cache_size
=
64M
-
join_buffer_size
=
8M
-
thread_concurrency
=
24
-
thread_cache_size
=
8
-
query_cache_size
=
0
-
query_cache_type
=
0
-
slow_query_log
=
1
-
long
-
query
-
time
=
1
-
transaction_isolation
=
REPEATABLE
-
READ
-
bulk_insert_buffer_size
=
64M
-
myisam_max_sort_file_size
=
10G
-
skip
-
name
-
resolve
-
event_scheduler
=
ON
-
transaction
-
isolation
=
READ
-
COMMITTED
-
log_bin_trust_function_creators
=
1
-
#skip
-
name
-
resolve
-
-
# binary logging is required
for
replication
-
log
-
bin
=
mysql
-
bin
-
expire_logs_days
=
1
-
#binlog_format
=
ROW
-
binlog_cache_size
=
64M
-
-
server
-
id
=
3307
-
-
innodb_data_home_dir
=
/
mysql
/
data
/
3307
-
innodb_data_file_path
=
ibdata1
:
10M
:
autoextend
-
innodb_log_group_home_dir
=
/
mysql
/
data
/
3307
-
innodb_buffer_pool_size
=
200m
-
innodb_log_file_size
=
500M
-
innodb_log_buffer_size
=
16M
-
innodb_flush_log_at_trx_commit
=
1
-
innodb_lock_wait_timeout
=
20
-
innodb_io_capacity
=
2000
-
innodb_buffer_pool_instances
=
3
-
innodb_purge_threads
=
1
-
innodb_stats_on_metadata
=
off
-
innodb_flush_method
=
O_DIRECT
-
innodb_file_per_table
=
true
-
innodb_print_all_deadlocks
=
1
-
-
[
mysqldump
]
-
quick
-
max_allowed_packet
=
16M
-
-
[
mysql
]
-
no
-
auto
-
rehash
-
# Remove the next
comment
character if you are not familiar with SQL
-
#safe
-
updates
-
-
[
myisamchk
]
-
key_buffer_size
=
20M
-
sort_buffer_size
=
20M
-
read_buffer
=
2M
- write_buffer = 2M
點選( 此處 )摺疊或開啟
-
[
client
]
-
#password
=
mysql123
-
port
=
3308
-
socket
=
/
mysql
/
data
/
3308
/
mysql
.
sock
-
default
-
character
-
set
=
utf8
-
# Here follows entries
for
some specific programs
-
-
# The MySQL
server
-
[
mysqld
]
-
ignore
-
db
-
dir
=
lost
+
found
-
federated
-
character
-
set
-
server
=
utf8
-
collation
-
server
=
utf8_bin
-
port
=
3308
-
socket
=
/
mysql
/
data
/
3308
/
mysql
.
sock
-
datadir
=
/
mysql
/
data
/
3308
-
skip
-
external
-
locking
-
lower
-
case
-
table
-
names
=
1
-
#MYISAM
-
max_connections
=
2048
-
key_buffer_size
=
512M
-
max_allowed_packet
=
16M
-
table_open_cache
=
2048
-
sort_buffer_size
=
8M
-
net_buffer_length
=
512K
-
read_buffer_size
=
8M
-
read_rnd_buffer_size
=
16M
-
myisam_sort_buffer_size
=
256M
-
query_cache_size
=
64M
-
join_buffer_size
=
8M
-
thread_concurrency
=
24
-
thread_cache_size
=
8
-
query_cache_size
=
0
-
query_cache_type
=
0
-
slow_query_log
=
1
-
long
-
query
-
time
=
1
-
transaction_isolation
=
REPEATABLE
-
READ
-
bulk_insert_buffer_size
=
64M
-
myisam_max_sort_file_size
=
10G
-
skip
-
name
-
resolve
-
event_scheduler
=
ON
-
transaction
-
isolation
=
READ
-
COMMITTED
-
log_bin_trust_function_creators
=
1
-
#skip
-
name
-
resolve
-
-
# binary logging is required
for
replication
-
log
-
bin
=
mysql
-
bin
-
expire_logs_days
=
1
-
#binlog_format
=
ROW
-
binlog_cache_size
=
64M
-
-
server
-
id
=
3308
-
-
innodb_data_home_dir
=
/
mysql
/
data
/
3308
-
innodb_data_file_path
=
ibdata1
:
10M
:
autoextend
-
innodb_log_group_home_dir
=
/
mysql
/
data
/
3308
-
innodb_buffer_pool_size
=
200m
-
innodb_log_file_size
=
500M
-
innodb_log_buffer_size
=
16M
-
innodb_flush_log_at_trx_commit
=
1
-
innodb_lock_wait_timeout
=
20
-
innodb_io_capacity
=
2000
-
innodb_buffer_pool_instances
=
3
-
innodb_purge_threads
=
1
-
innodb_stats_on_metadata
=
off
-
innodb_flush_method
=
O_DIRECT
-
innodb_file_per_table
=
true
-
innodb_print_all_deadlocks
=
1
-
-
[
mysqldump
]
-
quick
-
max_allowed_packet
=
16M
-
-
[
mysql
]
-
no
-
auto
-
rehash
-
# Remove the next
comment
character if you are not familiar with SQL
-
#safe
-
updates
-
-
[
myisamchk
]
-
key_buffer_size
=
20M
-
sort_buffer_size
=
20M
-
read_buffer
=
2M
- write_buffer = 2M
點選( 此處 )摺疊或開啟
-
[
client
]
-
#password
=
mysql123
-
port
=
3309
-
socket
=
/
mysql
/
data
/
3309
/
mysql
.
sock
-
default
-
character
-
set
=
utf8
-
# Here follows entries
for
some specific programs
-
-
# The MySQL
server
-
[
mysqld
]
-
ignore
-
db
-
dir
=
lost
+
found
-
federated
-
character
-
set
-
server
=
utf8
-
collation
-
server
=
utf8_bin
-
port
=
3309
-
socket
=
/
mysql
/
data
/
3309
/
mysql
.
sock
-
datadir
=
/
mysql
/
data
/
3309
-
skip
-
external
-
locking
-
lower
-
case
-
table
-
names
=
1
-
#MYISAM
-
max_connections
=
2048
-
key_buffer_size
=
512M
-
max_allowed_packet
=
16M
-
table_open_cache
=
2048
-
sort_buffer_size
=
8M
-
net_buffer_length
=
512K
-
read_buffer_size
=
8M
-
read_rnd_buffer_size
=
16M
-
myisam_sort_buffer_size
=
256M
-
query_cache_size
=
64M
-
join_buffer_size
=
8M
-
thread_concurrency
=
24
-
thread_cache_size
=
8
-
query_cache_size
=
0
-
query_cache_type
=
0
-
slow_query_log
=
1
-
long
-
query
-
time
=
1
-
transaction_isolation
=
REPEATABLE
-
READ
-
bulk_insert_buffer_size
=
64M
-
myisam_max_sort_file_size
=
10G
-
skip
-
name
-
resolve
-
event_scheduler
=
ON
-
transaction
-
isolation
=
READ
-
COMMITTED
-
log_bin_trust_function_creators
=
1
-
#skip
-
name
-
resolve
-
-
# binary logging is required
for
replication
-
log
-
bin
=
mysql
-
bin
-
expire_logs_days
=
1
-
#binlog_format
=
ROW
-
binlog_cache_size
=
64M
-
-
server
-
id
=
3309
-
-
innodb_data_home_dir
=
/
mysql
/
data
/
3309
-
innodb_data_file_path
=
ibdata1
:
10M
:
autoextend
-
innodb_log_group_home_dir
=
/
mysql
/
data
/
3309
-
innodb_buffer_pool_size
=
200m
-
innodb_log_file_size
=
500M
-
innodb_log_buffer_size
=
16M
-
innodb_flush_log_at_trx_commit
=
1
-
innodb_lock_wait_timeout
=
20
-
innodb_io_capacity
=
2000
-
innodb_buffer_pool_instances
=
3
-
innodb_purge_threads
=
1
-
innodb_stats_on_metadata
=
off
-
innodb_flush_method
=
O_DIRECT
-
innodb_file_per_table
=
true
-
innodb_print_all_deadlocks
=
1
-
-
[
mysqldump
]
-
quick
-
max_allowed_packet
=
16M
-
-
[
mysql
]
-
no
-
auto
-
rehash
-
# Remove the next
comment
character if you are not familiar with SQL
-
#safe
-
updates
-
-
[
myisamchk
]
-
key_buffer_size
=
20M
-
sort_buffer_size
=
20M
-
read_buffer
=
2M
- write_buffer = 2M
4.initialzation instance
/usr/bin/mysql_install_db --defaults-file=/mysql/data/3307/my.cnf --user=mysql --datadir=/mysql/data/3307
/usr/bin/mysql_install_db --defaults-file=/mysql/data/3308/my.cnf --user=mysql --datadir=/mysql/data/3308
/usr/bin/mysql_install_db --defaults-file=/mysql/data/3309/my.cnf --user=mysql --datadir=/mysql/data/3309
initialzation instance 3307 log
點選( 此處 )摺疊或開啟
-
[
root@dbdou01 mysql
]
#
/
usr
/
bin
/
mysql_install_db
-
-
defaults
-
file
=
/
mysql
/
data
/
3307
/
my
.
cnf
-
-
user
=
mysql
-
-
datadir
=
/
mysql
/
data
/
3307
-
Installing MySQL system tables
.
.
.
2016
-
06
-
23 11
:
17
:
11 0
[
Warning
]
'THREAD_CONCURRENCY'
is deprecated and will be removed in
a
future release
.
-
2016
-
06
-
23 11
:
17
:
11 0
[
Warning
]
TIMESTAMP with implicit DEFAULT
value
is deprecated
.
Please use
-
-
explicit_defaults_for_timestamp
server
option
(
see documentation
for
more details
)
.
-
2016
-
06
-
23 11
:
17
:
11 0
[
Note
]
/
usr
/
sbin
/
mysqld
(
mysqld 5
.
6
.
29
-
log
)
starting as process 26999
.
.
.
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Using atomics to ref count
buffer
pool pages
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
The InnoDB memory heap is
disabled
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Mutexes and rw_locks use GCC atomic builtins
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Memory barrier is not used
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Compressed tables use zlib 1
.
2
.
3
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Using Linux native AIO
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Using CPU crc32 instructions
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Initializing
buffer
pool
,
size
=
200
.
0M
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Completed initialization of
buffer
pool
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
The first specified
data
file
/
mysql
/
data
/
3307
/
ibdata1 did not exist
:
a
new database to be
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Setting
file
/
mysql
/
data
/
3307
/
ibdata1
size
to 10 MB
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Database physically writes the
file
full
:
wait
.
.
.
-
2016
-
06
-
23 11
:
17
:
11 26999
[
Note
]
InnoDB
:
Setting log
file
/
mysql
/
data
/
3307
/
ib_logfile101
size
to 500 MB
-
InnoDB
:
Progress in MB
:
100 200 300 400 500
-
2016
-
06
-
23 11
:
17
:
17 26999
[
Note
]
InnoDB
:
Setting log
file
/
mysql
/
data
/
3307
/
ib_logfile1
size
to 500 MB
-
InnoDB
:
Progress in MB
:
100 200 300 400 500
-
2016
-
06
-
23 11
:
17
:
23 26999
[
Note
]
InnoDB
:
Renaming log
file
/
mysql
/
data
/
3307
/
ib_logfile101 to
/
mysql
/
data
/
3307
/
ib_logfile0
-
2016
-
06
-
23 11
:
17
:
23 26999
[
Warning
]
InnoDB
:
New log files created
,
LSN
=
45781
-
2016
-
06
-
23 11
:
17
:
23 26999
[
Note
]
InnoDB
:
Doublewrite
buffer
not found
:
creating new
-
2016
-
06
-
23 11
:
17
:
23 26999
[
Note
]
InnoDB
:
Doublewrite
buffer
created
-
2016
-
06
-
23 11
:
17
:
24 26999
[
Note
]
InnoDB
:
128 rollback segment
(
s
)
are active
.
-
2016
-
06
-
23 11
:
17
:
24 26999
[
Warning
]
InnoDB
:
Creating foreign key constraint system tables
.
-
2016
-
06
-
23 11
:
17
:
24 26999
[
Note
]
InnoDB
:
Foreign key constraint system tables created
-
2016
-
06
-
23 11
:
17
:
24 26999
[
Note
]
InnoDB
:
Creating tablespace and datafile system tables
.
-
2016
-
06
-
23 11
:
17
:
24 26999
[
Note
]
InnoDB
:
Tablespace and datafile system tables created
.
-
2016
-
06
-
23 11
:
17
:
24 26999
[
Note
]
InnoDB
:
Waiting
for
purge to
start
-
2016
-
06
-
23 11
:
17
:
24 26999
[
Note
]
InnoDB
:
5
.
6
.
29 started
;
log sequence number 0
-
2016
-
06
-
23 11
:
17
:
25 26999
[
Note
]
Binlog end
-
2016
-
06
-
23 11
:
17
:
25 26999
[
Note
]
InnoDB
:
FTS optimize thread exiting
.
-
2016
-
06
-
23 11
:
17
:
25 26999
[
Note
]
InnoDB
:
Starting shutdown
.
.
.
-
2016
-
06
-
23 11
:
17
:
26 26999
[
Note
]
InnoDB
:
Shutdown completed
;
log sequence number 1625984
-
OK
-
-
Filling help tables
.
.
.
2016
-
06
-
23 11
:
17
:
26 0
[
Warning
]
'THREAD_CONCURRENCY'
is deprecated and will be removed in
a
future release
.
-
2016
-
06
-
23 11
:
17
:
26 0
[
Warning
]
TIMESTAMP with implicit DEFAULT
value
is deprecated
.
Please use
-
-
explicit_defaults_for_timestamp
server
option
(
see documentation
for
more details
)
.
-
2016
-
06
-
23 11
:
17
:
26 0
[
Note
]
/
usr
/
sbin
/
mysqld
(
mysqld 5
.
6
.
29
-
log
)
starting as process 27022
.
.
.
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Using atomics to ref count
buffer
pool pages
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
The InnoDB memory heap is
disabled
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Mutexes and rw_locks use GCC atomic builtins
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Memory barrier is not used
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Compressed tables use zlib 1
.
2
.
3
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Using Linux native AIO
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Using CPU crc32 instructions
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Initializing
buffer
pool
,
size
=
200
.
0M
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Completed initialization of
buffer
pool
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Highest supported
file
format is Barracuda
.
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
128 rollback segment
(
s
)
are active
.
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
Waiting
for
purge to
start
-
2016
-
06
-
23 11
:
17
:
26 27022
[
Note
]
InnoDB
:
5
.
6
.
29 started
;
log sequence number 1625984
-
2016
-
06
-
23 11
:
17
:
27 27022
[
Note
]
Binlog end
-
2016
-
06
-
23 11
:
17
:
27 27022
[
Note
]
InnoDB
:
FTS optimize thread exiting
.
-
2016
-
06
-
23 11
:
17
:
27 27022
[
Note
]
InnoDB
:
Starting shutdown
.
.
.
-
2016
-
06
-
23 11
:
17
:
28 27022
[
Note
]
InnoDB
:
Shutdown completed
;
log sequence number 1625994
-
OK
-
-
To
start
mysqld at boot time you have to
copy
-
support
-
files
/
mysql
.
server
to the right place
for
your system
-
-
PLEASE REMEMBER TO SET
A
PASSWORD
FOR
THE MySQL root USER
!
-
To do so
,
start
the
server
,
then issue the following commands
:
-
-
/
usr
/
bin
/
mysqladmin
-
u
root password
'new-password'
-
/
usr
/
bin
/
mysqladmin
-
u
root
-
h
10
.
124
.
110
.
113 password
'new-password'
-
##
[
root@dbdou01 mysql
]
#
/
usr
/
bin
/
mysqladmin
-
S
/
mysql
/
data
/
3307
/
mysql
.
sock
-
u
root password
'mysql123!'
-
##Warning
:
Using
a
password on the command line interface can be insecure
.
-
-
Alternatively you can run
:
-
-
/
usr
/
bin
/
mysql_secure_installation
-
-
which will also give you the
option
of removing the test
-
databases and anonymous user created by default
.
This is
-
strongly recommended
for
production servers
.
-
-
See the manual
for
more instructions
.
-
-
You can
start
the MySQL daemon with
:
-
-
cd
/
usr
;
/
usr
/
bin
/
mysqld_safe
&
-
##mysqld_safe
-
-
defaults
-
file
=
/
mysql
/
data
/
3307
/
my
.
cnf
&
-
-
You can test the MySQL daemon with mysql
-
test
-
run
.
pl
-
-
cd mysql
-
test
;
perl mysql
-
test
-
run
.
pl
-
-
Please report any problems at http
:
/
/
bugs
.
mysql
.
com
/
-
-
The latest information about MySQL is available on the web at
-
-
http
:
/
/
www
.
mysql
.
com
-
-
Support MySQL by buying support
/
licenses at http
:
/
/
shop
.
mysql
.
com
-
-
WARNING
:
Found existing config
file
/
usr
/
my
.
cnf on the system
.
-
Because this
file
might be in use
,
it was not replaced
,
-
but was used in bootstrap
(
unless you used
-
-
defaults
-
file
)
-
and when you later
start
the
server
.
-
The new default config
file
was created as
/
usr
/
my
-
new
.
cnf
,
- please compare it with your file and take the changes you need .
mysqld_safe --defaults-file=/mysql/data/3308/my.cnf &
/usr/bin/mysqladmin -S /mysql/data/3308/mysql.sock -u root password 'mysql123!'
/usr/bin/mysqladmin -S /mysql/data/3308/mysql.sock -u root -pmysql123! shutdown
mysqld_safe --defaults-file=/mysql/data/3309/my.cnf &
/usr/bin/mysqladmin -S /mysql/data/3309/mysql.sock -u root password 'mysql123!'
/usr/bin/mysqladmin -S /mysql/data/3309/mysql.sock -u root -pmysql123! shutdown
5. mysqld_multi start mysql and create user admin manage mysqld start or stop
vi /etc/my.cnf
點選( 此處 )摺疊或開啟
-
[
mysqld_multi
]
-
mysqld
=
/
usr
/
bin
/
mysqld_safe
-
mysqladmin
=
/
usr
/
bin
/
mysqladmin
-
user
=
admin
-
password
= password
-
-
[
mysqld3307
]
-
ignore
-
db
-
dir
=
lost
+
found
-
federated
-
character
-
set
-
server
=
utf8
-
collation
-
server
=
utf8_bin
-
port
=
3307
-
socket
=
/
mysql
/
data
/
3307
/
mysql
.
sock
-
datadir
=
/
mysql
/
data
/
3307
-
skip
-
external
-
locking
-
lower
-
case
-
table
-
names
=
1
-
#MYISAM
-
max_connections
=
2048
-
key_buffer_size
=
512M
-
max_allowed_packet
=
16M
-
table_open_cache
=
2048
-
sort_buffer_size
=
8M
-
net_buffer_length
=
512K
-
read_buffer_size
=
8M
-
read_rnd_buffer_size
=
16M
-
myisam_sort_buffer_size
=
256M
-
query_cache_size
=
64M
-
join_buffer_size
=
8M
-
thread_concurrency
=
24
-
thread_cache_size
=
8
-
query_cache_size
=
0
-
query_cache_type
=
0
-
slow_query_log
=
1
-
long
-
query
-
time
=
1
-
transaction_isolation
=
REPEATABLE
-
READ
-
bulk_insert_buffer_size
=
64M
-
myisam_max_sort_file_size
=
10G
-
skip
-
name
-
resolve
-
event_scheduler
=
ON
-
transaction
-
isolation
=
READ
-
COMMITTED
-
log_bin_trust_function_creators
=
1
-
#skip
-
name
-
resolve
-
-
# binary logging is required
for
replication
-
log
-
bin
=
mysql
-
bin
-
expire_logs_days
=
1
-
#binlog_format
=
ROW
-
binlog_cache_size
=
64M
-
-
server
-
id
=
3307
-
-
innodb_data_home_dir
=
/
mysql
/
data
/
3307
-
innodb_data_file_path
=
ibdata1
:
10M
:
autoextend
-
innodb_log_group_home_dir
=
/
mysql
/
data
/
3307
-
innodb_buffer_pool_size
=
200m
-
innodb_log_file_size
=
500M
-
innodb_log_buffer_size
=
16M
-
innodb_flush_log_at_trx_commit
=
1
-
innodb_lock_wait_timeout
=
20
-
innodb_io_capacity
=
2000
-
innodb_buffer_pool_instances
=
3
-
innodb_purge_threads
=
1
-
innodb_stats_on_metadata
=
off
-
innodb_flush_method
=
O_DIRECT
-
innodb_file_per_table
=
true
-
innodb_print_all_deadlocks
=
1
-
-
[
mysqldump
]
-
quick
-
max_allowed_packet
=
16M
-
-
[
mysql
]
-
no
-
auto
-
rehash
-
# Remove the next
comment
character if you are not familiar with SQL
-
#safe
-
updates
-
-
[
myisamchk
]
-
key_buffer_size
=
20M
-
sort_buffer_size
=
20M
-
read_buffer
=
2M
-
write_buffer
=
2M
-
-
-
[
mysqld3308
]
-
ignore
-
db
-
dir
=
lost
+
found
-
federated
-
character
-
set
-
server
=
utf8
-
collation
-
server
=
utf8_bin
-
port
=
3308
-
socket
=
/
mysql
/
data
/
3308
/
mysql
.
sock
-
datadir
=
/
mysql
/
data
/
3308
-
skip
-
external
-
locking
-
lower
-
case
-
table
-
names
=
1
-
#MYISAM
-
max_connections
=
2048
-
key_buffer_size
=
512M
-
max_allowed_packet
=
16M
-
table_open_cache
=
2048
-
sort_buffer_size
=
8M
-
net_buffer_length
=
512K
-
read_buffer_size
=
8M
-
read_rnd_buffer_size
=
16M
-
myisam_sort_buffer_size
=
256M
-
query_cache_size
=
64M
-
join_buffer_size
=
8M
-
thread_concurrency
=
24
-
thread_cache_size
=
8
-
query_cache_size
=
0
-
query_cache_type
=
0
-
slow_query_log
=
1
-
long
-
query
-
time
=
1
-
transaction_isolation
=
REPEATABLE
-
READ
-
bulk_insert_buffer_size
=
64M
-
myisam_max_sort_file_size
=
10G
-
skip
-
name
-
resolve
-
event_scheduler
=
ON
-
transaction
-
isolation
=
READ
-
COMMITTED
-
log_bin_trust_function_creators
=
1
-
#skip
-
name
-
resolve
-
-
# binary logging is required
for
replication
-
log
-
bin
=
mysql
-
bin
-
expire_logs_days
=
1
-
#binlog_format
=
ROW
-
binlog_cache_size
=
64M
-
-
server
-
id
=
3308
-
-
innodb_data_home_dir
=
/
mysql
/
data
/
3308
-
innodb_data_file_path
=
ibdata1
:
10M
:
autoextend
-
innodb_log_group_home_dir
=
/
mysql
/
data
/
3308
-
innodb_buffer_pool_size
=
200m
-
innodb_log_file_size
=
500M
-
innodb_log_buffer_size
=
16M
-
innodb_flush_log_at_trx_commit
=
1
-
innodb_lock_wait_timeout
=
20
-
innodb_io_capacity
=
2000
-
innodb_buffer_pool_instances
=
3
-
innodb_purge_threads
=
1
-
innodb_stats_on_metadata
=
off
-
innodb_flush_method
=
O_DIRECT
-
innodb_file_per_table
=
true
-
innodb_print_all_deadlocks
=
1
-
-
[
mysqldump
]
-
quick
-
max_allowed_packet
=
16M
-
-
[
mysql
]
-
no
-
auto
-
rehash
-
# Remove the next
comment
character if you are not familiar with SQL
-
#safe
-
updates
-
-
[
myisamchk
]
-
key_buffer_size
=
20M
-
sort_buffer_size
=
20M
-
read_buffer
=
2M
-
write_buffer
=
2M
-
-
-
[
mysqld3309
]
-
ignore
-
db
-
dir
=
lost
+
found
-
federated
-
character
-
set
-
server
=
utf8
-
collation
-
server
=
utf8_bin
-
port
=
3309
-
socket
=
/
mysql
/
data
/
3309
/
mysql
.
sock
-
datadir
=
/
mysql
/
data
/
3309
-
skip
-
external
-
locking
-
lower
-
case
-
table
-
names
=
1
-
#MYISAM
-
max_connections
=
2048
-
key_buffer_size
=
512M
-
max_allowed_packet
=
16M
-
table_open_cache
=
2048
-
sort_buffer_size
=
8M
-
net_buffer_length
=
512K
-
read_buffer_size
=
8M
-
read_rnd_buffer_size
=
16M
-
myisam_sort_buffer_size
=
256M
-
query_cache_size
=
64M
-
join_buffer_size
=
8M
-
thread_concurrency
=
24
-
thread_cache_size
=
8
-
query_cache_size
=
0
-
query_cache_type
=
0
-
slow_query_log
=
1
-
long
-
query
-
time
=
1
-
transaction_isolation
=
REPEATABLE
-
READ
-
bulk_insert_buffer_size
=
64M
-
myisam_max_sort_file_size
=
10G
-
skip
-
name
-
resolve
-
event_scheduler
=
ON
-
transaction
-
isolation
=
READ
-
COMMITTED
-
log_bin_trust_function_creators
=
1
-
#skip
-
name
-
resolve
-
-
# binary logging is required
for
replication
-
log
-
bin
=
mysql
-
bin
-
expire_logs_days
=
1
-
#binlog_format
=
ROW
-
binlog_cache_size
=
64M
-
-
server
-
id
=
3309
-
-
innodb_data_home_dir
=
/
mysql
/
data
/
3309
-
innodb_data_file_path
=
ibdata1
:
10M
:
autoextend
-
innodb_log_group_home_dir
=
/
mysql
/
data
/
3309
-
innodb_buffer_pool_size
=
200m
-
innodb_log_file_size
=
500M
-
innodb_log_buffer_size
=
16M
-
innodb_flush_log_at_trx_commit
=
1
-
innodb_lock_wait_timeout
=
20
-
innodb_io_capacity
=
2000
-
innodb_buffer_pool_instances
=
3
-
innodb_purge_threads
=
1
-
innodb_stats_on_metadata
=
off
-
innodb_flush_method
=
O_DIRECT
-
innodb_file_per_table
=
true
-
innodb_print_all_deadlocks
=
1
-
-
[
mysqldump
]
-
quick
-
max_allowed_packet
=
16M
-
-
[
mysql
]
-
no
-
auto
-
rehash
-
# Remove the next
comment
character if you are not familiar with SQL
-
#safe
-
updates
-
-
[
myisamchk
]
-
key_buffer_size
=
20M
-
sort_buffer_size
=
20M
-
read_buffer
=
2M
-
write_buffer
=
2M
-
-
[
mysqldump
]
-
quick
-
max_allowed_packet
=
256M
-
[
mysql
]
-
no
-
auto
-
rehash
-
prompt
=
\
\
u
@
\
\
d \\R
:
\
\
m
>
-
[
myisamchk
]
-
key_buffer_size
=
512M
-
sort_buffer_size
=
512M
-
read_buffer
=
8M
-
write_buffer
=
8M
-
[
mysqlhotcopy
]
-
interactive
-
timeout
-
[
mysqld_safe
]
- open - files - limit = 8192
[mysql@dbdou01 ~]$ mysql -uroot -pmysql123! -S /mysql/data/3307/mysql.sock
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.29-log MySQL Community Server (GPL)
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.
) 16:00>GRANT SHUTDOWN ON *.* TO
IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)
) 16:00>flush privileges;
Query OK, 0 rows affected (0.00 sec)
##mysqld_multi start
mysqld_multi start 3307-3309
## check mysql port
[root@dbdou01 ~]# netstat -ntlp | grep mysql
tcp 0 0 :::3307 :::* LISTEN 8935/mysqld
tcp 0 0 :::3308 :::* LISTEN 8941/mysqld
tcp 0 0 :::3309 :::* LISTEN 8934/mysqld
6.Boot from the start
vi /etc/init.d/mysql_boot.local
/usr/bin/mysqld_multi start 3307-3309
參考:
http://blog.chinaunix.net/uid-25760152-id-3472603.html
http://blog.csdn.net/leshami/article/details/40339167
########################################################################################
版權所有,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!【QQ交流群:53993419】
QQ:14040928 E-mail:
本文連結:
http://blog.itpub.net/26442936/viewspace-2120848/
########################################################################################
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-2120848/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL5.6新特性之Multi-Range ReadMySql
- SAP Spartacus Multi-Site Configuration
- RedHat 5.6_x86_64 + ASM + RAW+ OracRedhatASM
- No instances available for XXXAI
- CentOS 安裝 mysql 5.6CentOSMySql
- MySQL:5.6 升級 5.7MySql
- Windows 安裝 MySQL 5.6WindowsMySql
- MySQL 5.6 GTID 原理以及使用MySql
- MySQL 5.6的表壓縮MySql
- Linux安裝Mysql5.6LinuxMySql
- Windows 安裝並配置 MySQL 5.6WindowsMySql
- Mysql5.6 自動化部署MySql
- MySQL5.6 create table原理分析MySql
- RedHat下MySQL的基本使用方法分享RedhatMySql
- redhat 5.4下安裝MYSQL全過程RedhatMySql
- zabbix6.2新增mysql資料庫監控MySql資料庫
- Linux上yum安裝mysql5.6LinuxMySql
- MySQL 5.6對大表做歸檔MySql
- mysql5.6 mysqldump備份報錯MySql
- MySQL5.6 PERFORMANCE_SCHEMA 說明MySqlORM
- redhat 6.5 mysql 升級5.5.48經mysql 5.6.32至mysql 5.7.16實施概略RedhatMySql
- 6.2
- 【Mysql】MySQL 5.6中如何定位DDL被阻塞的問題MySql
- skipped: maximum number of running instances reached (1)
- mysql5.6生成排序欄位MySql排序
- mysql 5.6效能監控表innodb_metricsMySql
- CentOS 6.7下yum方式安裝MySQL 5.6CentOSMySql
- MySQL 5.6 遭遇 OS bug INNODB MONITOR OUTPUT 事件MySql事件
- centos7 mysql5.6升級5.7CentOSMySql
- MySQL最優配置模板( 5.6&5.7轉)MySql
- MySQL 5.6建索引的正確姿勢MySql索引
- Mysql 5.6 Master和Slave 主備切換MySqlAST
- Exata 6.2
- Centos7或RedHat7下安裝MysqlCentOSRedhatMySql
- 【Zabbix】使用zabbix 3.4自帶Mysql模板,監控Redhat 7.0上的MysqlMySqlRedhat
- The following instances are in the device manifest but not specified in framework compatibility matrix:devFramework
- centOS 7 離線安裝 MySQL 5.6 完美安裝CentOSMySql
- MySQL 5.6 innodb_io_capacity引數效能測試MySql
- MySQL 5.6中如何定位DDL被阻塞的問題MySql