Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I’ve got one droplet at DO and one webspace with domain at another hosting provider. I don’t have access to anything other than ftp on the other server. On that other webspace I’ve got a php script which I want to remotely connect to my mySQL db on my droplet. I’ve opened the port 3306 in the firewall, added a user with access to the table from % and changed the row starting with “bind-adress” (also tried commenting out) in the configuration file. Still I get an error like this when trying to connect:
Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY000] [2002] Connection timed out’ in {the url to the script that’s trying to connect}:19 Stack trace: #0 {the url to the script that’s trying to connect}(19): PDO->__construct('mysql:host={my droplet public ip}, ‘{username}’, ‘{password}’) #1 {main} thrown in {the url to the script that’s trying to connect} on line 19
And the connection part in php looks like this:
$db = new PDO(‘mysql:host={droplet public ip};port=3306;dbname={database name};charset=utf8’, ‘{username}’, ‘{password}’);
What am I doing wrong?! I’ve contacted the DO support, they couldn’t help me since we don’t know where the problem is. They told me to try the community.
hbarnard
keneucker
keneucker
rich
santoshpatil
Aspiresoftserv
Yakin
Thejaswini-Rao-U
775c69c916d345a7a367d867078ccb
mayricoak
ndam
bc2f52583874402a988f587c00195d