CentOS6.5 a single server to install multiple MySQL databases simultaneously

Source: Internet
Author: User

Build users and Groups

Groupadd MySQL

useradd-g MySQL MySQL

Download Source:

wget https://downloads.mariadb.org/interstitial/mariadb-10.1.10/source/mariadb-10.1.10.tar.gz

TAR-XVF mariadb-10.1.10.tar.gz

1. Compiling:

CMake. -dcmake_install_prefix=/var/lib/mysql3377/-dmysql_datadir=/var/lib/mysql3377/data/-DSYSCONFDIR=/var/lib/ Mysql3377/etc-dwith_innobase_storage_engine=1-dwith_archive_storage_engine=1-dwith_blackhole_storage_engine=1- Dwith_readline=1-dwith_ssl=system-dwith_zlib=system-dwith_libwrap=0-dmysql_unix_addr=/tmp/mysql3377.sock- Ddefault_charset=utf8-ddefault_collation=utf8_general_ci

Make

Make install

2. Initialize DB

/var/lib/mysql3377/scripts/mysql_install_db--user=mysql--datadir=/var/lib/mysql3377/data/

3. Copy my.cnf

#cp support-files/my-medium.cnf/var/lib/mysql3377/etc/my.cnf

4, modify the MY.CNF

5. Copy Mysql.server to/ETC/RC.D/INIT.D

CP support-files/mysql.server/etc/rc.d/init.d/mysql3377

6. Modify Permissions

chmod +x/etc/rc.d/init.d/mysql3377

7, modify the mysql3377

vim/etc/rc.d/init.d/mysql3377 Modify 2 places:

1) conf=/var/lib/mysql3377/etc/my.cnf

2)

8. Modify Directory Permissions

Chown-r root:mysql/var/lib/mysql3377/

Chown-r mysql:mysql/var/lib/mysql3377/data/

9. Add self-starter

Chkconfig mysql3377 on

10. Configure a second database:

Purge compiled files

Make clean

RM CMakeCache.txt

Repeat 1-9 steps.

CentOS6.5 a single server to install multiple MySQL databases simultaneously

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.