New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

any host vs localhost vs ip

Started by carlmiller, May 03, 2021, 06:18:54 AM

Previous topic - Next topic

carlmiller

Hi,

When setting user privileges in mysql manager,

am i forced to using any host? when I want my db user to connect from a remote server?

Currently I have localhost set, so my inital website works fine as the db is on the localhost.

I also have an external server which queries my db, so selected "specify ip address" which allows the connection.

Unfortunately this broke the local connection as well.

So i have to use "% Any Host" to get around this.

Can I not specify localhost and also a single ip address?

reason i am concerned is that if the db user pw is comprimised then they can potentially gain access to my db because the user has "% Anyhost" access.

Is there a way to force localhost and single remote IP?

narin

Hello carlmiller;

It is simple to overcome this problem you have experienced and to address your anxiety.

First, add the IP addresses that you want to access 3306 port through the firewall as trusted, then block all requests to port 3306. (As 0.0.0.0/0)

Thus, even if you set the database to access all IP addresses while adding users, only the IP addresses that you allow access through the firewall will be able to access.

Good work.