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

MySQL5.5 multi-instance installation

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

Share

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

one。 Introduction of multiple examples

1.1 what is MySQL multi-instance

To put it simply, it is to open different ports on a server and run multiple MySQL service processes, which pass through the

Different socket listens to different service ports to provide their own services.

The functions and problems of 1.2MySQL Multi-instance

1.2.1 effective use of server resources

Note: in the enterprise, do not let the server resources left too much, and do not use the server resources close to all, you have to flow out part of the redundancy.

1.2.1 Save server resources

1.2.2 Resource preemption problem

When a MySQL concurrency is high, the entire MySQL instance consumes the resources of the entire server, which affects other services. So there should be time constraints on multi-instance servers.

1.3Common configuration schemes for multi-instance MySQL installation

1 "

Chapter 5 of the official manual of MySQL.

II. Cmake compilation and installation 5.5.32

2.1 installation of cmake compiler software

Cd / home/oldboy/tools/ tar xf cmake-2.8.8.tar.gz cd cmake-2.8.8. / configure

2.2 dependency packages during installation of MySQL

Yum install ncurses-devel-y

2.3 install MySQL

2.3.1 create users and groups used by MySQL

Groupadd mysql useradd mysql-s / sbin/nologin-M-g mysql

2.3.2 decompress and compile cmake to install MySQL

Tar zxf mysql-5.5.32.tar.gz cd mysql-5.5.32cmake. -DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.32\-DMYSQL_DATADIR=/application/mysql-5.5.32/data\-DMYSQL_UNIX_ADDR=/application/mysql-5.5.32/tmp/mysql.sock\-DDEFAULT_CHARSET=utf8\-DDEFAULT_COLLATION=utf8_general_ci\-DEXTRA_CHARSETS=gbk,gb2312,utf8 Ascii\-DENABLED_LOCAL_INFILE=ON\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_FEDERATED_STORAGE_ENGINE=1\-DWITH_BLACKHOLE_STORAGE_ENGINE=1\-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\-DWITHOUT_PARTITION_STORAGE_ENGINE=1\-DWITH_FAST_MUTEXES=1\-DWITH_ZLIB=bundled\-DENABLED_LOCAL_INFILE=1\-DWITH_READLINE=1\-DWITH_EMBEDDED_SERVER=1\-DWITH_DEBUG=0make make install

2.3.3 initialization and launch of multiple instances

1 "increase or decrease the global startup path of MySQL

Add export PATH=/application/mysql/bin:$PATH to the / etc/profile file

Source / etc/profile makes the configuration file effective

2 "initialize the database

He is to initialize the basic files of the database, some tables and libraries.

Will be installed in / application/mysql-5.5.32 to make a soft connection

Ln-s mysql-5.5.32 mysql./mysql_install_db-basedir=/application/mysql-datadir=/data/3306/data-user=mysql./mysql_install_db-basedir=/application/mysql-datadir=/data/3307/data-user=mysql

The presence of two ok indicates that initialization is successful

/ data/3306/mysql startStarting MySQL.../data/3307/mysql startStarting MySQL... [root@loveyu scripts] # netstat-lnt | grep 330tcp 0 0 0.0.0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 of the netstat * LISTEN tcp 0 0 0. 0. 0. 0. 0. 0. 0. 0 of the 3306 0. 0. 0. 0 of the range *.

Attachment: http://down.51cto.com/data/2366894

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