Connecting to an online database
Solved
Tom
-
Tom -
Tom -
Hello,
I would like to access my database on my website for free. For that, I put it on db4free.net.
Then, I connect to it in PHP from a site I posted on biz.nf.
The command to connect is:
$bdd = new PDO('mysql:host=db4free.net; port=3306; dbname=name', '
user', 'password');
The user and password are the ones I use to connect to the database on www.db4free.net/phpMyAdmin.
On the site, the error "SQLSTATE[HY000] [2002] Connection refused" appears without me understanding why...
Could someone help me please?
I would like to access my database on my website for free. For that, I put it on db4free.net.
Then, I connect to it in PHP from a site I posted on biz.nf.
The command to connect is:
$bdd = new PDO('mysql:host=db4free.net; port=3306; dbname=name', '
user', 'password');
The user and password are the ones I use to connect to the database on www.db4free.net/phpMyAdmin.
On the site, the error "SQLSTATE[HY000] [2002] Connection refused" appears without me understanding why...
Could someone help me please?
Otherwise, could you please suggest another method to display my database, through other sites whose methods have been verified for example?
While looking online, some indicate that the port used by db4free might be 3307 instead of 3306..
You can give it a try.
https://codes-sources.commentcamarche.net/faq/10778-heidisql-tester-ses-requetes-sql
Personally.. I just created a test database on their site.. and I can't even access it via phpMyAdmin...