How to enable remote MySQL access on Debian & Linux

This walkthrough is designed for any Debian-based distribution.

Step 1: open /etc/mysql/my.cnf.

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>'; FLUSH PRIVILEGES;

Done!

How to enable remote MySQL access on Debian & Linux

Leave a Reply

Scroll to top