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

Deploy multiple instances through the MySQL 8.0 binary installation package

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Extract the installation package

Cd / usr/localtar xvf mysql-8.0.12-linux-glibc2.12-x86_64.tar.xzmv mysql-8.0.12-linux-glibc2.12-x86_64 mysqlcd mysql/mkdir confexport PATH=$PATH:/usr/local/mysql/bin

Instance 1 profile my00.cnf

[mysqld] basedir=/usr/local/mysqldatadir=/var/lib/mysql00socket=/tmp/mysql00.socksymbolic-links=0port=3306mysqlx_port= 33060[mysqld _ safe] log-error=/var/log/mysqld00.logpid-file=/var/lib/mysql00/mysqld.pid

Instance 2 configuration file my01.cnf

[mysqld] basedir=/usr/local/mysqldatadir=/var/lib/mysql01socket=/tmp/mysql01.socksymbolic-links=0port=3307mysqlx_port= 33070[mysqld _ safe] log-error=/var/log/mysqld01.logpid-file=/var/lib/mysql01/mysqld.pid

Instance 3 configuration file my02.cnf

[mysqld] basedir=/usr/local/mysqldatadir=/var/lib/mysql02socket=/tmp/mysql02.socksymbolic-links=0port=3308mysqlx_port= 33080[mysqld _ safe] log-error=/var/log/mysqld02.logpid-file=/var/lib/mysql02/mysqld.pid

Initialize an instance

Mysqld-defaults-file=/usr/local/mysql/conf/my00.cnf-initialize-user=mysqlmysqld-defaults-file=/usr/local/mysql/conf/my01.cnf-initialize-user=mysqlmysqld-defaults-file=/usr/local/mysql/conf/my02.cnf initialize user=mysql

Start the instance

Mysqld_safe-defaults-file=/usr/local/mysql/conf/my00.cnf-user=mysql & mysqld_safe-defaults-file=/usr/local/mysql/conf/my01.cnf-user=mysql & mysqld_safe-defaults-file=/usr/local/mysql/conf/my02.cnf-user=mysql &

Modify the password

Mysql-S / tmp/mysql00.sock-u root-pALTER USER root@'localhost' IDENTIFIED BY 'MySQL8.0';mysql-S / tmp/mysql01.sock-u root-pALTER USER root@'localhost' IDENTIFIED BY' MySQL8.0';mysql-S / tmp/mysql02.sock-u root-pALTER USER root@'localhost' IDENTIFIED BY 'MySQL8.0'

Close the instance

Mysqladmin-S / tmp/mysql00.sock-u root-pMySQL8.0 shutdownmysqladmin-S / tmp/mysql01.sock-u root-pMySQL8.0 shutdownmysqladmin-S / tmp/mysql02.sock-u root-pMySQL8.0 shutdown

Note: account root@'locahost' uses socket to connect to the database

Reference documentation: running multiple MySQL instances on Unix

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