By ozwiz
I am trying to connect to remote MySQL server from my local PC. I am getting “10061” error.
Here are the steps I followed:
bind-address in file /etc/mysql/mysql.conf.d/mysqld.conf to the droplet ip.I have disabled firewall too. But still not able to connet to it. One more thing I have a live site using the same MySQL database, changing bind-address to droplet IP makes the server throw Internal Server Error. Why is that ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
One more thing I have a live site using the same MySQL database, changing bind-address to droplet IP makes the server throw Internal Server Error.
This is because Bind Address defines on what network interface MySQL listens for connections.
By default, it’s set to 127.0.0.0 (i.e. localhost), which means you’ll be able to access MySQL only using that address.
Changing Bind Address to Droplet’s IP will instruct MySQL to listen for connection only via IP. In that case, you will not be able to access MySQL over 127.0.0.0 or localhost and your application will probably fail.
The solution is to set Bind Address to 0.0.0.0 allowing you to access MySQL via any (IPv4) network interface. Now, you can access to MySQL from using all addresses, including 127.0.0.0, localhost and Droplet’s Public IP.
Make sure to restart MySQL after you’re done with changes, to put them in the effect.
Also, what IP address you provided in that GRANT command? Is it Droplet’s IP or you local one? You can also use % instead of an IP to allow access from any IP. It’s not recommended to use % though, as it’s insecure, but sometimes easier, such as when you have dynamic IP.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.