A new project’s required me to have access to a MYSQL database from a REMOTE IP address.
There are conflicting information about this, so in order to get the thing done correctly, here’s a reminder of the various steps:
1.Check /etc/my.cnf, normally the file’s already correct (Since Plesk 8), Reference here
2. open mysql shell session with:
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` mysql
3. add credential to allow remote IP to connect to specific database:
GRANT ALL ON foo.* TO bar@'192.168.0.1' IDENTIFIED BY 'PASSWORD';
REVOKE GRANT OPTION ON foo.* FROM bar@'192.168.0.1';
- “foo” is the database name
- “bar” is the database user name
- “192.168.0.1” is the remote IP address
- “PASSWORD” is the password, a random value (NOT PASSWORD!)
4. Open the Mysql port( 3306) on the Plesk Firewall (in the Modules section)
5. Test the connection using:
telnet host 3306
- “host” is the Plesk server to access.
A connection should then be able to be made.