准备环境
192.168.1.1(Altas)
192.168.1.2(MySQL主)
192.168.1.3(MySQL从)
一、配置主从数据库访问连接
#依次设置主库,从库允许Atlas访问连接
mysql>GRANT FILE ON *.* TO 'root'@'192.168.1.1' IDENTIFIED BY 'root password'; #创建用户
#或者
mysql> grant all on *.* to root@'127.0.0.1' identified by "root"; #创建用户
# 进入数据库
mysql> use mysql
# 修改host权限为"%"
mysql> update user set host = '%' where user = 'root';
以上两种方式任意一种均可
mysql>select host ,user ,password from mysql.user; #查看是否修改成功
mysql>FLUSH PRIVILEGES; #更新数据库信息,否则需要重启数据库
二、安装Atlas
注意事项:
(1).Atlas只能安装运行在64位的系统上。
(2).Centos 5.X安装 Atlas-XX.el5.x86_64.rpm,Centos 6.X安装Atlas-XX.el6.x86_64.rpm。
(3).如果执行安装rpm -ivh Atlas-2.2.1.el6.x86_64.rpm出现下面错误说明已经安装
Preparing... ########################################### [100%]
package Atlas-2.2.1-1.x86_64 is already installed
使用[root@localhost ~]# rpm -qa|grep Atlas// 查询出来已安装的Atlas
[root@localhost ~]# cd /home/
[root@localhost home]# wget https://github.com/Qihoo360/Atlas/releases/download/2.2.1/Atlas-2.2.1.el6.x86_64.rpm
2.安装
[root@localhost home]# rpm -ivh Atlas-2.2.1.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:Atlas ########################################### [100%]
安装地址
[root@localhost home]# ll /usr/local/mysql-proxy/
total 16
drwxr-xr-x. 2 root root 4096 Dec 28 10:47 bin #bin目录下放的