Accessing database using php

Hi there,

I was trying to access my sql database by using php code, as follow:

$conn = mysqli_connect(‘’, ‘fceu_19119221’, ‘my_password’, ‘mydb_name’ );

and I got the error of ‘Connection refused.’.

Did I access the right database server correctly? I did use the database server with the one shown in my cpanel, and using right password and my username. However still not work. Can anyone give me a hand?

Thank you for your support and providing the free web hosting service.


The settings seem to be OK from what I can see. Just make sure you’re using the correct database name (it’s prefixed by your account username) and the correct password. Do you still experience this problem?

Hi Administrator,
Looks like now it is working, no idea why and that is weird haha. I will let you know if it is not working again. Thanks you very much for your help!