Remote Access Problem

Started by LuigiMdg, November 21, 2017, 05:13:38 PM

Previous topic - Next topic

LuigiMdg

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):
Quotebind-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:
QuotePHP Warning:  mysqli::mysqli(): (HY000/2002): Connection timed out in /home3/xstuttoi/public_html/xxx.php on line 9

24x7servermanagement

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 !!

locvfx

#2
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'%";