mysql access denied from php

Status
Not open for further replies.

roshn.singh65

New Member
Messages
2
Reaction score
0
Points
0
Hi,
I found a lot of relevant entries in forum and the wiki and i am still struggling to fix this:

Link: http://sroshan.x10.bz/v.php

This is what i am using in my PHP script:

$db = 'sroshan_temp';
$host = 'localhost';
$user = 'sroshan_roshan';
$pass = 'xxxx';

$link = mysql_connect($host, $user, $pass);
if (!$link) {
die('Could not connect: ' . mysql_error());
}

This is what I see on the page:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sroshan_sroshan'@'web4.vital.x10hosting.com' (using password: YES) in /home/sroshan/public_html/v.php on line 10
Could not connect: Access denied for user 'sroshan_sroshan'@'web4.vital.x10hosting.com' (using password: YES)
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
Hi,
I found a lot of relevant entries in forum and the wiki and i am still struggling to fix this:

Link: http://sroshan.x10.bz/v.php

This is what i am using in my PHP script:

$db = 'sroshan_temp';
$host = 'localhost';
$user = 'sroshan_roshan';
$pass = 'xxxx';

$link = mysql_connect($host, $user, $pass);
if (!$link) {
die('Could not connect: ' . mysql_error());
}

This is what I see on the page:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sroshan_sroshan'@'web4.vital.x10hosting.com' (using password: YES) in /home/sroshan/public_html/v.php on line 10
Could not connect: Access denied for user 'sroshan_sroshan'@'web4.vital.x10hosting.com' (using password: YES)

Why the Code details and the error details are not matching?

In code it says username as sroshan_roshan

and the error is saying sroshan_sroshan

Anyway did you created the database and username in cpanel ?
Did you given permissions to the user?


Check the procedure --> How to Create a MySQL Database and User
 

roshn.singh65

New Member
Messages
2
Reaction score
0
Points
0
I have two users for the db sroshan_roshan and sroshan_sroshan with all the permissions set as indicated in the link you mentioned.

I tried creating one more db and user but it did not work out.
 
Status
Not open for further replies.
Top