Mysql – How to allow MySQL Remote Access from a dynamic IP

MySQLremote-access

I've tried searching for an answer, but can't quite find it.

I need to remotely access a MySQL instance through the local MySQL Workbench. The port is turned on (I believe). I can Telnet into it.

All the examples I see say something along the lines of

GRANT ALL PRIVILEGES ON *.* TO USER-NAME@IP IDENTIFIED BY "PASSWORD";

The trouble with this is that I'm remoting in from a dynamic IP. The error I get is

Access denied for user 'root'@'c-67-166-150-41.hsd1.ca.comcast.net' (using password: YES)

How do I set it up to allow me in? I do have root access to the MySQL Workbench on the remote machine if I remote control in.

Thanks

Best Answer

You should try to use the "%" for the host part. Something like:

GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

(Taken from MySQL Documentation)

Make sure that the changes take effect properly with:

flush privileges