Get the App
SLTechnology News&Howtos  ›  Database  › 

Multi Multi-instance launch mysql tutorial

Shulou Source: shulou.com Published: 2022-06-01 20:27:00 11月15日 Update

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.

Tags: Examples tutorials specialties content knowledge configuration different below books people value available in suggestions technologies methods more servers users ports red Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker macOS NVidia vpn Apple