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?
2 answers
-
Hello,
If you have entered the correct credentials and the correct database name, you can try replacing the host with its IP 85.10.205.173
--
Best regards,
Jordane-
The name of the database is indeed the one displayed on phpmyadmin, the credentials are the ones for connecting to phpmyadmin, and I have exactly the same problem when replacing it with the IP.
Otherwise, could you please suggest another method to display my database, through other sites whose methods have been verified for example?- Try to connect to it using software like HeidiSQL
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...
-
-