Create a MySQL Cluster _ MySQL

Source: Internet
Author: User
Preparations: obtain the 1mysql configuration file awindows find the mysql client shortcut and right-click-& gt; the file path in the property target is the storage location of the configuration file. Preparations:

1. obtain the mysql configuration file

A. in windows, find the mysql client shortcut and right-click it. the file path in the property target is the storage location of the configuration file.

Objective: "C: \ Program Files \ MySQL Server 5.6 \ bin \ mysql.exe ""

-- Defaults-file = C: \ ProgramData \ MySQL Server 5.6 \ my. ini ""-uroot ""-p"

Here, defaults-file specifies the configuration file path.

B. enter find-name "my. cnf" in linux to return to the mysql configuration file path.

2. start, stop, and restart Mysql

1. in windows, right-click the mysql service in the Task Manager and choose> operation

B. linux Terminal:

Service mysqld start -- start service mysqld stop -- suspend service mysqld restart -- restart

3. Register and uninstall the Mysql service in Window

Register mysql service: mysqld install mysql -- defaults-file = "C: \ Program Files \ mysql-5.7.12 \ my. cnf"
Uninstall mysql service: mysqld remove mysql

1 Master 1 slave server

Environment introduction: one Mysql 5.5.37 x86 server under win10 mysql5.6 x64 server and one CentOS release 6.3 (Final)

Mysql5.5.37 as master 5.6 as Slave

Operation:

1>. configure my. cnf for the master.

[Mysqld] server_id = 1 # (if not specified, the default value is 1) log-bin = master-bin

2>. configure my. cnf for slave

[mysqld]server-id=2relay_log=slave-relay-binrelay_log_index=slave-relay-bin.index

3>. restart the master and slave services respectively.

4>. create a replication slave user on the master host

create user repl_user;GRANTREPLICATION SLAVE ON *.* TO repl_user IDENTIFIED BY 'xyzzy';

5>. run

CHANGE MASTER TO MASTER_HOST='121.89.42.1',MASTER_PORT=3306, MASTER_USER='repl_user',MASTER_PASSWORD='xyzzy';

6>. run START slave on the SLAVE host.

7>. execute SHOW slave STATUS display on the SLAVE host.

Success.

The above describes how to build a MySQL Cluster _ MySQL. For more information, see The PHP Chinese network (www.php1.cn )!

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.