通過Amoeba連接Mysql

安裝好amoeba後,啓動

修改兩個文件,amoeba-mysql-binary-2.2.0/conf目錄下dbServers.xml和amoeba.xml(即設置下mysql連接密碼)

<pre name="code" class="sql">vi dbServers.xml
<!--  mysql password 
                        <property name="password">123456</property>
-->
改爲(其中<!-- -->爲註釋,要去掉)
<!--  mysql password -->
                        <property name="password">123456</property>

vi amoeba.xml
 <property name="password">password</property>
改爲
 <property name="password">123456</property>

啓動amoeba

/root/amoeba-mysql-binary-2.2.0/bin/amoeba start
log4j:WARN log4j config load completed from file:/root/amoeba-mysql-binary-2.2.0/conf/log4j.xml
2015-10-15 17:05:10,393 INFO  context.MysqlRuntimeContext - Amoeba for Mysql current versoin=5.1.45-mysql-amoeba-proxy-2.2.0
log4j:WARN ip access config load completed from file:/root/amoeba-mysql-binary-2.2.0/conf/access_list.conf
2015-10-15 17:05:10,649 INFO  net.ServerableConnectionManager - Amoeba for Mysql listening on 0.0.0.0/0.0.0.0:8066.
2015-10-15 17:05:10,649 INFO  net.ServerableConnectionManager - Amoeba Monitor Server listening on /127.0.0.1:50513.
連接mysql(端口改爲8066即可)

<pre name="code" class="sql">mysql -uroot  -h127.0.0.1 -P8066 -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1719451110
Server version: 5.1.45-mysql-amoeba-proxy-2.2.0 MySQL Community Server (GPL)

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

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| bbp                |
| lmis               |
| mtms               |
| myisam             |
| mysql              |
| performance_schema |
| test               |
| zabbix             |
+--------------------+





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章