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

CentOS 6.8 compile and install MySQL5.5.32 (two multiple instances)

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

Share

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

Configuration of multiple instances of MySQL

By compiling and installing MySQL5.5.32 from CentOS 6.8 above, we have completed the compilation and installation, and then configure multiple instances

This picture draws lessons from Xu Liangwei's "thinking diagram".

5. Add multi-instance directory

[root@db01 application] # mkdir-p / data/ {3306 root@db01 application 3307} / data [root@db01 application] # tree / data//data/ ├── 3306 │ └── data └── 3307 └── data

6. Upload multi-instance configuration files

[root@db01 /] # cd / [root@db01 /] # rz-y data.zip [root@db01 /] # unzip data.zip [root@db01 /] # tree datadata ├── 3306 # # 3306 instance directory │ ├── data │ ├── my.cnf └── mysql └── 3307 ├── data ├── my.cnf └── mysql

# # there are only strings 3306 and 3307 in the multi-instance file comparison configuration file, which is different from that of serverID

7, add execution permissions to the Mysql startup script

Find / data-type f-name "mysql" | xargs chmod 700chown-R mysql.mysql / data

8. Initialize multiple instances, which is used to load the libraries and tables that come with mysql # #

Cd / application/mysql/scripts./mysql_install_db-- defaults-file=/data/3306/my.cnf-- basedir=/application/mysql/-- datadir=/data/3306/data-- user=mysql./mysql_install_db-- defaults-file=/data/3307/my.cnf-- basedir=/application/mysql/-- datadir=/data/3307/data-- user=mysql## hint:-- basedir=/application/mysql/ is the installation path of MySQL,-- datadir is the data file directory. Also, notice that the paths of mysql_install_db and MySQL5.1 are different, and MySQL5.1 is no longer under the MySQL bin path.

During the compilation process, note that it takes 2 OK to be successful.

[root@db02 scripts] # / mysql_install_db-- basedir=/application/mysql-- datadir=/data/3306/data-- user=mysqlWARNING: The host 'db02' could not be looked up with resolveip.This probably means that your libc libraries are not 100% compatiblewith this binary MySQL version. The MySQL daemon, mysqld, should worknormally with the exception that hostname resolving will not work.This means that you should use IP addresses instead of hostnameswhen specifying MySQL privileges! Installing MySQL system tables...OK #

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