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

Detailed steps for MySQL5.6.35 database installation using multi-instance binaries

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

Share

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

The following to understand the MySQL5.6.35 database using multi-instance binary installation detailed steps, I believe you will benefit a lot after reading, the text in the essence is not much, hope that the MySQL5.6.35 database use multi-instance binary installation detailed steps of this short article is what you want.

I. Software package

Wget-Q http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz

2. Decompression and movement

Tar xf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz

Mkdir-p / application/mysql

Mv mysql-5.6.35-linux-glibc2.5-x86_64 / application/mysql/mysql-5.6.35

Useradd-s / sbin/nologin-M mysql

Chown-R mysql.mysql / application/mysql/

Cd / application/mysql/mysql-5.6.35/

III. System setup

3.1 turn off iptables

Temporary shutdown: service iptables stop

Permanent shutdown: chkconfig iptables off

3.2 close selinux

Vi / etc/sysconfig/selinux

Change SELINUX to DISABLED, namely SELINUX=DISABLED

3.3 Environmental variables

Echo 'exportPATH=/application/mysql/mysql-5.6.35/bin:$PATH

'> > / etc/profile

Source / etc/profile

Tail-1/etc/profile

ExportPATH=/application/mysql/mysql-5.6.35/bin:$PATH

4. Configure mysql

4.1 create related directories

Mkdir-p/data/ {3306 ~ 3307}

Mkdir-p/data/3306/ {data,log,tmp}

Mkdir-p/data/3307/ {data,log,tmp}

4.2 change directory permissions

Chown-Rmysql:mysql / data/

Chown-Rmysql:mysql / application/mysql/

4.3 copy the my.cnf file to the etc directory

Cp / application/mysql/mysql-5.6.35/support-files/my-default.cnf/etc/my.cnf

4.4 modify my.cnf (just modify it in a file)

Cat / etc/my.cnf

[client]

Port=3306

Socket=/tmp/mysql.sock

[mysqld_multi]

Mysqld = / application/mysql/mysql-5.6.35/bin/mysqld_safe

Mysqladmin = / application/mysql/mysql-5.6.35/bin/mysqladmin

Log = / data/mysqld_multi.log

[mysqld]

User=mysql

Basedir = / application/mysql/mysql-5.6.35

Sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysqld3306]

Mysqld=mysqld

Mysqladmin=mysqladmin

Datadir=/data/3306/data

Port=3306

Server_id=3306

Socket=/tmp/mysql_3306.sock

Log-output=file

Slow_query_log = 1

Long_query_time= 1

Slow_query_log_file= / data/3306/log/slow.log

Log-error = / data/3306/log/error.log

Binlog_format = mixed

Log-bin = / data/3306/log/mysql3306_bin

[mysqld3307]

Mysqld=mysqld

Mysqladmin=mysqladmin

Datadir=/data/3307/data

Port=3307

Server_id=3307

Socket=/tmp/mysql_3307.sock

Log-output=file

Slow_query_log = 1

Long_query_time= 1

Slow_query_log_file= / data/3307/log/slow.log

Log-error = / data/3307/log/error.log

Binlog_format = mixed

Log-bin = / data/3307/log/mysql3307_bin

4.5 initialize the database

Initialize the 3306 database

/ application/mysql/mysql-5.6.35/scripts/mysql_install_db-basedir=/usr/local/mysql/-datadir=/data/3306/data--defaults-file=/etc/my.cnf

Initialize the 3307 database

/ application/mysql/mysql-5.6.35/scripts/mysql_install_db-basedir=/usr/local/mysql/-datadir=/data/3307/data--defaults-file=/etc/my.cnf

Check whether the database is initialized successfully

Two "OK" appear

4.6 check whether the database is initialized successfully

View 3306 database

Ls / data/mysql/mysql_3306/data

Auto.cnf ibdata1 ib_logfile0 ib_logfile1 mysql mysql.pid performance_schema test

View 3307 database

Ls / data/mysql/mysql_3307/data

Auto.cnf ibdata1 ib_logfile0 ib_logfile1 mysql mysql.pid performance_schema test

4.7 set up the startup file

Cp / application/mysql/mysql-5.6.35/support-files/mysql.server/etc/init.d/mysql

5. Start maintenance

5.1 start all instances

/ application/mysql/mysql-5.6.35/bin/mysqld_multi start

/ application/mysql/mysql-5.6.35/bin/mysqld_multi report

After reading this article on the detailed steps of using multi-instance binary installation in MySQL5.6.35 database, many readers will want to know more about it. For more industry information, you can follow our industry information section.

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