Allowing Remote Connections - MySQL

Error Message

The following error is seen when attempting to connect remotely to MySQL running on a Linux machine.

Host 'xx.xx.xx.xx' is not allowed to connect to this MySQL Server

Resolution

The resolution is to log into the MySQL instance locally, then grant access to the remote user, as follows.

1. Connect to the instance via Putty.

2. Log into the local MySQL instance.

mysql -u root -p

3. Change to the "mysql" database

use mysql

4. Grant privileges to the remote "root" user

grant all on *.* to root@'ip-address' identified by 'root-password';

Reverting

To revert the above process, execute the following procedure while connected to the MySQL instance.

use mysql
drop user root@'ip-address';