It is currently Thu Mar 28, 2024 9:50 am


All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: MySQL connection refused
PostPosted: Fri Jun 26, 2015 6:33 pm 
Newbie
Newbie

Joined: Fri Jun 26, 2015 6:18 pm
Posts: 2
I have a script that connects to MySQL database, executes a query and sends the result as json data as a response. However I keep getting "Connection refused" as a response when using the following PHP method in the script:

$conn = mysqli_connect( "mydomainname.com", "myusername", "mypassword", "mydatabasename" );

I tested everything locally with EasyPHP DevServer and now that it's ready for production I inserted all records on the database at freehostia and moved the script to my domain at freehostia, but it doesn't work...

I tried the IP address as the host parameter for mysqli_connect but nothing is returned, not even a "echo" method works with that... What am I doing wrong, isn't the host my domain name ? I know that the username and database name are the same and correct, and I am sure that the password is correct, so that only leaves the host parameter as wrong only if I should not use my domain name...

Any help would be welcome

Thanks


Top
 Profile  
 
 Post subject: Re: MySQL connection refused
PostPosted: Wed Jul 01, 2015 11:47 am 
Newbie
Newbie

Joined: Fri Jun 26, 2015 6:18 pm
Posts: 2
Ok, localhost worked.. Thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ]  Moderators: Moderators, Support Team

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Hosting | Domains | Servers | Extras | Order | Support | Contacts | FreeHostia © 2011