Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Multi Multi-instance launch mysql tutorial

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following content mainly brings you multi multi-instance start mysql tutorials, the knowledge here is slightly different from books, are summarized by professional and technical personnel in the process of contact with users, have a certain experience sharing value, hope to bring help to the majority of readers.

Assuming that there is a 3306 instance running before the CVM, we need to add another instance on port 3316.

Edit / etc/my.cnf directly and add the following (the red part is the configuration item to be added later):

[client]

User= root

Socket= / tmp/mysql.sock

Port= 3306

[mysql]

Prompt='[\ d] >'

[mysqld]

Datadir=/bdata/data/nowdb2

Socket= / tmp/mysql.sock

User=mysql

Port= 3306

Character-set-server= utf8

Default_storage_engine= InnoDB

Transaction_isolation = READ-COMMITTED

Skip_name_resolve= ON

Skip_external_locking

Query_cache_type= OFF

Query_cache_size= 0

Server-id= 11

Log-bin= mysql.bin

Binlog_format= ROW

Log_error= / bdata/data/nowdb2/error.log

Innodb_file_per_table = ON

[mysqld_multi]

Mysqld = / usr/local/mysql/bin/mysqld_safe

Log = / var/log/mysqld_multi.log

[mysqld2]

Datadir=/data/mysql2

Socket = / tmp/mysql2.sock

User=mysql

Port = 3316

Character-set-server = utf8

Default_storage_engine = InnoDB

Transaction_isolation = READ-COMMITTED

Skip_name_resolve = ON

Skip_external_locking

Server-id = 106

Log-bin = mysql-bin

Slow_query_log = ON

Slow_query_log_file = / data/mysql2/localhost_slow.log

Long_query_time = 5

Log_error = / data/mysql2/error.log

Innodb_file_per_table = ON

Innodb_flush_log_at_trx_commit = 1

Sync_binlog = 1

Innodb_support_xa = 1

Sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Symbolic-links=0

Relay_log_info_repository = table

Master_info_repository = table

Relay_log_recovery = ON

[mysqld_safe]

Log-error=/var/log/mysqld.log

Pid-file=/var/run/mysqld.pid

[mysqldump]

Quick

Max_allowed_packet= 64M

Initialize 3316 instances:

/ usr/local/mysql/scripts/mysql_install_db--user=mysql-basedir=/usr/local/mysql/-datadir=/data/mysql2/

Start 3316 instance:

Mysqld_multireport

You can start 3316 instances with mysqld_multistart 3316.

In the same way, you can configure other mysql instances.

If it is closed, it is recommended to use mysqladmin.

Note that mysqld_mulit has nothing to do with the startup and stop of the original mysqld. We can close / etc/init.d/mysqld without having any effect on the instance started by mysqld_multi.

For the above mysql tutorials on multi multi-instance launch, if you have more information to learn, you can continue to follow our industry promotion. If you need professional solutions, you can contact the pre-sales and after-sales tutorials on the official website. I hope this article can bring you some knowledge updates.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report