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

Multiple mysql databases are installed on the same server

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

Share

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

[preface] multiple mysql databases are often needed to simulate various environments and scenarios in the test environment. Because the resources in the test environment are generally limited, it is necessary to build multiple mysql databases on one server to complete the testing requirements. This document describes how to install multiple mysql 5.7databases in an Centos6.4 environment.

[1] installation of mysql database software

Mysql database software officially provides three installation files and methods, as follows:

RPM mode installation binary mode installation source code compilation installation

Although the source code installation method is more troublesome, but the individual is still used to using the source code solution installation, mysql5.7 installation and early 5.5 installation methods and steps are almost the same, so I will not explain here.

[2] create multiple databases

The installation of the software is actually the same, but the creation of the database is a little different.

2.1 to plan the data file directory, this environment installs 5 databases, creates 5 folders under / data, and distinguishes them by port number

Collapse or open here) collapse or open [root@db01 mysql3307] # cat / etc/my.cnf

[mysqld_multi]

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

# basedir = / usr/local/mysql

Mysqladmin = / usr/local/mysql/bin/mysqladmin

User = mysql

Pass = mysql

Through the above operations, the operation of installing multiple mysql databases on a single server is completed.

Attaching: common operation statements

/ usr/local/mysql/bin/mysqld_multi start # start all databases

/ usr/local/mysql/bin/mysqld_multi start 7 # start a single database

/ usr/local/mysql/bin/mysqld_multi stop # shut down all databases

/ usr/local/mysql/bin/mysqld_multi stop 7 # shut down a single database

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