Join me on Facebook!
— Written by Triangles on December 24, 2016 • updated on December 24, 2016 • ID 46 —
How to allow remote connections from any host to your MySQL server.
This walkthrough is designed for any Debian-based distribution.
Step 1: open
Step 2: comment out the
bind-address line, which tells MySQL where to listen. If you remove it, MySQL will accept any connection. You could also assign an IP address like
bind-address = <ip-here> if you wish to give access to a specific machine. Comment it out otherwise.
Step 3: restart mysql service with
sudo service mysql restart.
Step 4: finally, grant permission to MySQL users from any host:
GRANT ALL PRIVILEGES ON *.* TO <your-user-here>@'%' IDENTIFIED BY '<user-password-here>';
MySQL - MySQL 5.7 Reference Manual: Server Command Options (link)