Multi-instance MySQL database installation detailed

Source: Internet
Author: User
Tags reserved

First, the experimental environment

System: cetos6.5

Software: mysql-5.5.32.tar.gz

Second, the experimental steps

1.1 Installing CMake Software

Tar XF cmake-2.8.8.tar.gz

CD cmake-2.8.8

./configure

Gmake

Gmake Install


1.2 Creating users and groups and installing MySQL dependency packages

Groupadd MySQL

Useradd mysql-s/sbin/nologin-m MSYQL

Yum-y Install Ncurses-devel

1.3 Unzip the compiler to install MySQL

Tar XF mysql-5.5.32.tar.gz

CD mysql-5.5.32.tar.gz

CMake. -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=0


Make && make install


1.4 Configuring environment variables to write to the/etc/profile file

Path= "/application/mysql/bin: $PATH"

1.5 Creating a multi-instance directory startup script configuration file and its authorization

/data/
├──3306
│├──data
│├──my.cnf
│└──mysql
└──3307
├──data
├──my.cnf
└──mysql

Chown-r mysql.mysql/data/

find/data/-type f-name "MySQL" |xargs chmod +x

/data/3306/mysql Start---Starting the MySQL process

/data/3307/mysql Start---Starting the MySQL process

1.6 Login MySQL via socket multi-instance mode

Mysql-s/data/3306/mysql.sock

Mysql-s/data/3307/mysql.sock

1.7 Change Password

mysqladmin-uroot-s/data/3306/mysql.sock password ' 123 '
mysqladmin-uroot-s/data/3307/mysql.sock password ' 123 '


1.8 How to login after password change

Mysql-uroot-p-s/data/3306/mysql.sock

Mysql-uroot-p-s/data/3307/mysql.sock


1.9 Achieving Login Success

~] #mysql-uroot-p-s/data/3306/mysql.sock
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 2
Server version:5.5.32 Source Distribution

Copyright (c) and/or, Oracle, its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

Mysql>


~] #mysql-uroot-p-s/data/3307/mysql.sock
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 2
Server version:5.5.32 Source Distribution

Copyright (c) and/or, Oracle, its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

Mysql>

This article is from "Wake up your not alarm clock but dream" blog, please be sure to keep this source http://purify.blog.51cto.com/10572011/1795031

Multi-instance MySQL database installation detailed

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.