Get the App
SLTechnology News&Howtos  ›  Database  › 

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

Shulou Source: shulou.com Published: 2022-06-01 11:20:16 09月21日 Update

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 #

Tags: Instance file data database log configuration directory path service success command method script error problem compilation above variables that is permissions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Docker Linux OPPO Reno macOS