1:已经事先购买了两台云主机
10.4.14.168 101.69.178.208 [联通] Master
10.4.5.9 101.69.178.219 [联通] Slave
2:分别安装MySQL
#yum install mysql-server –enablerepo=remi
#yum install mysql-devel
3:查看MySQL安装情况
[[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:启动MySQL
service mysqld start
5:登陆MySQL并且修改密码并且删除空用户
mysql> UPDATE mysql.user SET password = PASSWORD(‘ge0513.mysql‘)
-> WHERE user = ‘root‘;
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> SELECT user,host,password FROM mysql.user;
+------+-------------+-------------------------------------------+
| user | host | password |
+------+-------------+-------------------------------------------+
| root | localhost | *7AE39BE5035D5C32361400FF7DEDD757AA76896A |
| root | 10-4-14-168 | *7AE39BE5035D5C32361400FF7DEDD757AA76896A |
| root | 127.0.0.1 | *7AE39BE5035D5C32361400FF7DEDD757AA76896A |
| | localhost | |
| | 10-4-14-168 | |
+------+-------------+-------------------------------------------+
5 rows in set (0.00 sec)
mysql> DROP user ‘‘@localhost;
Query OK, 0 rows affected (0.00 sec)
mysql> DROP user ‘‘@‘10-4-14-168‘;
Query OK, 0 rows affected (0.00 sec)