• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

external mysql db access

P

parisdns

Guest
Hi, all, just wonder how can I setup under plesk to allow a external server to access the mysql db.

Thanks.
 
Just make sure your firewall isn't blocking access to the MySQL port (3306) and it should just work.
 
I think you also need to grant access to a user in the right way. By default a database user created through Plesk is user@localhost and trying to login from a remote location would be rejected because they are not connecting from localhost.

So I think you need to GRANT xxx TO 'user'@'ipaddress' identified by 'password' for the database in question (or something like that --- I don't remember the syntax exactly).

xxx could be ALL but that's a security risk. You should limit it to what's needed rather than ALL. Using @'ipaddress' limits the connection to the static IP where the remote connection is coming from. I think you can also use a domain instead of an IP, and therefore control the IP via a DNS entry. You may also be able to grant to user rather than user@ but it would be more sensible to limit it to an IP if possible, even if your fireall only allows access to port 3306 from their static IP. Every extra level of security you add helps!

Have a look at the GRANT syntax to see what you can do. Like I say I can't remember the exact options off-hand.

Faris.
 
In addition to what has already been said, check your /etc/my.cnf file and make sure that skip-networking isn't in there. If it is, comment it out (#) and restart MySQL.

All the best,

Simon
 
Back
Top