MySQL builds master-slave on the cloud host

Source: Internet
Author: User

1: Two cloud hosts have been purchased in advance

10.4.14.168 101.69.178.208 [Unicom] Master

10.4.5.9 101.69.178.219 [Unicom] Slave

2: Install MySQL separately


#Yum Install Mysql-server–enablerepo=remi

#Yum Install Mysql-devel

3: View MySQL installation status

[[email protected] ~] # Rpm-qa | grep mysql*

MySQL-5.1.73-3.el6_5.x86_64
MySQL-libs-5.1.73-3.el6_5.x86_64
MySQL-server-5.1.73-3.el6_5.x86_64
MySQL-devel-5.1.73-3.el6_5.x86_64


4: Start MySQL

Service mysqld Start

5: Log in to MySQL and change the password and delete the empty user

MySQL> UPDATEMySQL.User SETPassword=PASSWORD ('Ge0513.mysql') 

-WHEREUser='Root';
Query OK,3Rows Affected (0.00Sec
Rows matched:3Changed:3Warnings:0

Mysql>SELECTUser, Host,password fromMysql.User;
+------+-------------+-------------------------------------------+
| User|Host|Password|
+------+-------------+-------------------------------------------+
|Root|localhost|*7ae39be5035d5c32361400ff7dedd757aa76896a|
|Root|Ten-4- --168| *7ae39be5035d5c32361400ff7dedd757aa76896a|
|Root|127.0.0.1|*7ae39be5035d5c32361400ff7dedd757aa76896a|
||localhost||
||Ten-4- --168 ||
+------+-------------+-------------------------------------------+
5RowsinchSet(0.00Sec
Mysql>DROPUser"'@localhost;
Query OK,0Rows Affected (0.00Sec

Mysql>DROPUser"'@'10-4-14-168';
Query OK,0Rows Affected (0.00Sec

MySQL builds master-slave on the cloud host

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.