Cant connect to MYSQL through PHP

Status
Not open for further replies.

adityajoshi5

New Member
Messages
3
Reaction score
0
Points
0
Hello

I've written this to connect mysql database thru php
$host = "radiance.x10.mx";
$user = "radiance_****";
$pass = "********";
$db = "radiance_****";
$link = mysql_connect($host, $user, $pass);
mysql_select_db($db, $link);

I recieve the following error on webpage
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /home/radiance/public_html/articles.php on line **

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/radiance/public_html/articles.php on line **
Sorry! Couldn't Link the Database

Please tell me the problem here. I do it while while still working on my computer's xampp server on localhost

-----------------------------------------
Now I've made a little change.

$host = "localhost";
$user = "radiance_****";
$pass = "********";
$db = "radiance_****";
$link = mysql_connect($host, $user, $pass);
mysql_select_db($db, $link) or die(mysql_error());

It says -
Access denied for user 'radiance_*******'@'IP.IP.IP.%' to database 'radiance_****'

Whats wrong?
 
Last edited:

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Please provide instructions on how we can reproduce the issue.
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Since we have not received a response I am marking this as resolved. If further assistance is needed please re-open this thread or create a new one. You can re-open this thread by clicking on the "Administrative" text at the top of the original post.
 
Status
Not open for further replies.
Top