Author Topic: Remote Access Problem  (Read 9491 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Remote Access Problem
« on: November 21, 2017, 05:13:38 PM »
Hi..
I've a problem with mysql remote access..
I've created this user to access to tuttoinchiostro's database:

I've setted a php connection with the IP of my server in the host of mysqli connection..
I've disabled the firewall on my server and I've added this row in the MySQL Configuration (/etc/my.cnf):
Quote
bind-address=xx.xx.xxx.xxx (ip of server that send the request to access)
But on php error log of the requesting serve, they take to me this error:
Quote
PHP Warning:  mysqli::mysqli(): (HY000/2002): Connection timed out in /home3/xstuttoi/public_html/xxx.php on line 9

Offline
**
Re: Remote Access Problem
« Reply #1 on: November 23, 2017, 07:29:02 AM »
Is MySQL service running on the server?

Are you using this code if not then try and let me know if it works.

$conn = mysqli_connect($servername, $username, $password, $dbname);
https://www.24x7servermanagement.com/
Server Management, Server Security, Server Monitoring.
India's Leading Managed Service Provider !!

Offline
***
Re: Remote Access Problem
« Reply #2 on: January 11, 2018, 10:43:33 AM »
Add port 3306 to your firewall rules (both IN and OUT), then you can connect to your mysql outside of the server

Grant remote access to specific IP All Database
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'1.2.3.4' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
Revoke permision:
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'USERNAME'@'1.2.3.4';
Check permission
SELECT * from information_schema.user_privileges where grantee like "'USERNAME'%";
« Last Edit: January 11, 2018, 10:48:40 AM by locvfx »