SEU
SEU

Reputation: 1390

Connect to a MySQL server on another server

I have a website hosted by namecheap and trying to move it to AWS. For now, I want to keep using the MySQL server on namecheap. I searched online for solutions and one was to whitelist the AWS ip address in the cpanel. That option doesn't exist in my cpanel.

Any suggestions?

Upvotes: 0

Views: 57

Answers (1)

InYeopTTi
InYeopTTi

Reputation: 1044

You have to make a user with AWS ip address.

  1. Allow specific IP

    mysql> grant all privileges on *.* to ‘user’@‘12.34.56.78’ identified by ‘user's password’;

  2. Allow IP with wildcard (12.34.0.0/16)

    mysql> grant all privileges on *.* to ‘user’@‘12.34.%’ identified by ‘user's password’;

  3. Allow all IP

    mysql> grant all privileges on *.* to ‘user’@‘%’ identified by ‘user's password’

Applying changes

mysql> flush privileges;

You have to modify mf.cnf to listen port comment

#bind-address = 127.0.0.1

in my.cnf

then restart your mysql server

Upvotes: 2

Related Questions