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.
root@(none) 16:00>GRANT SHUTDOWN ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)
root@(none) 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://www.dbdream.com.cn/2016/03/24/%E4%BD%BF%E7%94%A8mysql_install_db%E8%84%9A%E6%9C%AC%E5%88%9D%E5%A7%8B%E5%8C%96mysql%E6%95%B0%E6%8D%AE%E5%BA%93%E5%AE%9E%E4%BE%8B/
http://blog.chinaunix.net/uid-25760152-id-3472603.html
http://blog.youkuaiyun.com/leshami/article/details/40339167
########################################################################################
版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!【QQ交流群:53993419】
QQ:14040928 E-mail:dbadoudou@163.com
本文链接: http://blog.itpub.net/26442936/viewspace-2120848/
########################################################################################
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26442936/viewspace-2120848/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26442936/viewspace-2120848/