1130 Host 'amazon-ec2-ip' is not allowed to connect to this MySQL server -
i facing problem in accessing mysql db on 1 of amazon ec2 servers ec2 server. read through various articles regarding providing appropriate permissions mysql accessed external ip addresses, , here steps followed:
- opened port 3306 on host ec2 instance allow external mysql connection.
- in file /etc/mysql/my.cnf, changed "bind-address" "127.0.0.1" "0.0.0.0".
- opened mysql using root, , executed following command: grant privileges on . worker@'ec2-ip-address' identified 'password';
as per blogs/articles read, should have solved issue, keep getting following error:
1130 host 'amazon-ec2-ip' not allowed connect mysql server the ip address providing ec2 instance elastic ip gets generated when create instance. verify whether issue specific ec2, tried executing command "3" different "static ip address". now, worked me (i.e. able login mysql host remote server), sure above steps correct.
why amazon ec2 ip address not working?
after posting problem, working, realized wasn't able ping ec2 server or telnet it. basic had wrong. friend helped me out problem. had expected, problem specific ec2.
the details follows:
when create ec2 instance, external ip address similar to: ec2-xx-xxx-xxx-xx.ap-southeast-1.compute.amazonaws.com
while setting permissions in mysql granting permissions above ip address, i.e.:
grant privileges on . worker@'ec2-xx-xxx-xxx-xx.ap-southeast1.compute.amazonaws.com' identified 'password'; this not work when try communicate ec2 instance local ec2 instance. this, need provide 'internal ip address" of ec2 instance, can found using ip command:
ip a:
1: lo: <loopback,up,lower_up> mtu 16436 qdisc noqueue state unknown link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <broadcast,multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state qlen 1000 link/ether 12:31:41:02:58:47 brd ff:ff:ff:ff:ff:ff inet **xx.xx.xx.xxx/23** brd yy.yyy.yy.yyy scope global eth0 inet6 fe80::1031:41ff:fe02:5847/64 scope link valid_lft forever preferred_lft forever to things working correctly, need grant permission ip address --"xx.xxx.xx.xxx/23", , should work. similarly, while connecting "mysql" database, hostname provided mysql command should "internal ip address" of host ec2 instance.
Comments
Post a Comment