MySQLに接続するために、MySQL Workbench
(http://www-jp.mysql.com/products/workbench/)
を試してみたが、MySQLの接続はデフォルトでローカルのみなので、許可が必要
sqlコマンドで以下のように実行すれば、外部の特定ホストから接続できるようです。
1 |
mysql>grant all privileges on zabbix.* to zabbix@"192.168.29.41" identified by 'zabbix' wi th grant option; |
また、全ホストからの接続を可能とする場合は、以下のようにすればいいようです。
1 2 |
mysql> grant all privileges on zabbix.* to zabbix@"%" identified by 'zabbix' with grant option; Query OK, 0 rows affected (0.00 sec) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
[root@zabbix2 ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 354142 Server version: 5.1.67 Source distribution Copyright (c) 2000, 2012, 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> select user,host from mysql.user; +--------+-----------------+ | user | host | +--------+-----------------+ | root | 127.0.0.1 | | | localhost | | root | localhost | | zabbix | localhost | | | zabbix2.2.local | | root | zabbix2.2.local | +--------+-----------------+ 6 rows in set (0.02 sec) mysql> shuw datadases -> l -> Ctrl-C -- exit! Aborted [root@zabbix2 ~]# [root@zabbix2 ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 354176 Server version: 5.1.67 Source distribution Copyright (c) 2000, 2012, 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 | | mysql | | test | | zabbix | +--------------------+ 4 rows in set (0.00 sec) mysql> grant all privileges on zabbix.* to zabbix@"192.168.29.41" identified by 'zabbix' wi th grant option; Query OK, 0 rows affected (0.03 sec) mysql> select user,host from mysql.user; +--------+-----------------+ | user | host | +--------+-----------------+ | root | 127.0.0.1 | | zabbix | 192.168.29.41 | | | localhost | | root | localhost | | zabbix | localhost | | | zabbix2.2.local | | root | zabbix2.2.local | +--------+-----------------+ 7 rows in set (0.00 sec) |
1 |