CMR
CMR

Reputation: 1416

MySQL remote connection from outside network

I'm trying to let a client on another network remotely connect to a database i;ve setup, but every time I try and setup the connection for them, i get SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'servername' (110)

I have the following:

I have tested it from other servers INSIDE our network, e.g. my own local PC and from another one of our web servers, setting up a MySQL user for those specific hosts, and it works fine. It's just this one outside our network that doesn't work.

Could it be something on their end that is stopping them being able to connect? Or have I missed anything?

Thanks.

Upvotes: 0

Views: 317

Answers (1)

Abhishek Ginani
Abhishek Ginani

Reputation: 4751

To access MySQL from outside. you should enable MySQL remote access .

Here is the way to do so:

1- Comment out following lines in Mysql Config(my.cnf)

#bind-address           = 127.0.0.1
#skip-networking

2- Save the file and restart Mysql server

3- Update GRANT privilege

By default, mysql username and password you are using is allowed to access mysql-server locally. So need to update privilege.

Run following query to update privilege

GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

Change the 'USERNAME' to your Database user and 'PASSWORD' to User Password

Upvotes: 1

Related Questions