Amazon Server Mysql Remote Access

Asked

Viewed 1,576 times

1

I am unable to connect to a user for remote access in my database. I already created the user, gave permission to access any ip ( % ) - ja dei permissões em cima do ip que estou usando e mesmo assim, apenas o erro : (2003) - Can t connect to Mysql (10060) aparece quando tentar conectar.

  • I’ve shut down the firewall, checked the installation. Apparently everything ok.

Server is from Amazon - linux.

I tried to access mysql through ssh, but it returns the error (2002).

Anyone can help?

  • I suggest you read two links: http://stackoverflow.com/questions/9766014/connect-to-mysql-amazon-amazon-ec2-from-a-remote-server and also http://kylegoslin.wordpress.com/2012/05/18/109/ . If the two links do not resolve, warn them to take another look.

  • If one of the answers helped you mark the best answer and vote for all that helped you. So you make sure that whoever wrote the answer gets something in return, in addition to making the site cleaner and more useful for everyone.

  • According to the previous answers, I think you should check the bind in my.cnf file and check if port 3306 is released in the instance’s security group.

3 answers

2

Mysql has a my.cnf configuration file this file by default restricts access, making it possible only to access it locally by ip blocking. Through the following line:

bind-address            = 127.0.0.1

If you comment on that line

# bind-address            = 127.0.0.1

And restart the database it must respect the privileges you set up in the database as for example access from any ip '%'. If you have already done this and it didn’t work, you should check what is occurring through the Mysql log file.

You can access this tutorial in order to review the procedures you have done to allow external access to your database.

  • 1

    Instead of commenting on the bind-address line, I recommend using "bind-address = xxx.xxx.xxx.xxx" where xxx is the server IP. (the unquoted syntax...)

0

I suggest you use the Amazon Web Services RDS service. This is the "right way" to manage Mysql databases in the AWS cloud. RDS offers several advantages such as automatic backups, automatic server updates and a configured environment for this.

-1

In the my.cnf or my.ini file, specify the bind-address on a different port.

port = 10002
bind-address = xxx.xxx.xxx.xxx

The reason for changing the standard port is that the port 3306 may be blocked in the network. So regardless of releasing your server’s firewall, the network it depends on will not allow by default.

In bind-address, instead of xxx.xxx.xxx.xxx put your server’s external IP.

Finally, make sure you are editing the correct file. You might happen to have copies of my.cnf in different locations and you edit a file that has nothing to do with it. Then you edit, save, restart and nothing happens. rsrsrs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.