MySql Error

Status
Not open for further replies.

scipets2

New Member
Messages
28
Reaction score
1
Points
0
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'scipets1'@'lotus.x10hosting.com' (using password: NO) in /home/scipets1/public_html/insert.php on line 156

I Keep getting that error whenever I go on my site, it has been like that for 2 days now and I think the time now has came to post the problem on the forums. I have read the news topics regarding this error and have changed the host to localhost and even have remade the user. I have no Idea what I have done wrong:dunno:
Please help
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Note in the error message:
(using password: NO)
This either means you're not passing a password, or you're using mysql_connect, which is failing, and you've suppressed errors from it. Rather than suppressing errors, set your own error handler or switch to PDO and use exceptions.
 

scipets2

New Member
Messages
28
Reaction score
1
Points
0
Not helping much. my domain is scipets.co.cc if that helps, you can see the error in action there.

My dbinfo.php as I call it is fine

$dbinf['host'] = "localhost";
//put your database username in here
$dbinf['uname'] ="scipets1_main";
//put your database password in here
$dbinf['pword'] ="(password hidden)";
//put your database name in here
$dbinf['dbase'] ="scipets1_Main";
:dunno:

Did not work :frown:
 
Last edited by a moderator:

Jarryd

Community Advocate
Community Support
Messages
5,534
Reaction score
43
Points
48
Everyone that posted here is almost incorrect. The error clearly shows the password is not being used when trying to access the database, since you seem to have the password set as a variable, i'd check that the mysql_connect() function is actually using the password when trying to connect. Can you please post your mysql_connect() from the insert.php file?
 
Last edited:

scipets2

New Member
Messages
28
Reaction score
1
Points
0
Will post when I get home.
Edit:
mysql_connect($dbinf['host'], $dbinf['uname'], $dbinf['pword']);
@mysql_select_db($dbinf['dbase']) or die("Database Error, Please try again later.");
that's the connect code
note it all worked fine before the upgrade.
 
Last edited:

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Will post when I get home.
Edit:
mysql_connect($dbinf['host'], $dbinf['uname'], $dbinf['pword']);
@mysql_select_db($dbinf['dbase']) or die("Database Error, Please try again later.");
that's the connect code
note it all worked fine before the upgrade.

Is that from line 156 in insert.php? I'm hoping you're about to say "no it's from somewhere else," cause the error's on 156 and I can't see a problem with that line at all given the code you pasted for the $dbinf stuff :(
 

scipets2

New Member
Messages
28
Reaction score
1
Points
0
mysql_connect($dbinf['host'], $dbinf['uname'], $dbinf['pword']); =156
@mysql_select_db($dbinf['dbase']) or die("Database Error, Please try again later."); =157
 

shubhas2007

New Member
Messages
34
Reaction score
0
Points
0
Warning: mysql_query() [function.mysql-query]: Unable to save result set in /home/searchfi/public_html/includes/functions.php on line 920

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/searchfi/public_html/includes/functions.php on line 921
0
 

Zubair

Community Leader
Community Support
Messages
8,766
Reaction score
305
Points
83

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'scipets1'@'lotus.x10hosting.com' (using password: NO)

My dbinfo.php as I call it is fine

$dbinf['host'] = "localhost";
//put your database username in here
$dbinf['uname'] ="scipets1_main";
//put your database password in here
$dbinf['pword'] ="(password hidden)";
//put your database name in here
$dbinf['dbase'] ="scipets1_Main";

Something is wrong with this picture.

Wild guess:

dbinfo.php is not included or is included after the connection is attempted.
 
Last edited:

chrislynk

New Member
Messages
2
Reaction score
0
Points
0
So I had the same problem and ran thru the same resolution attempts. Finally found that adding my account panel username to my sql user worked. Something like this ...

Was: $con = mysql_connect("localhost","myuser","XXXXXXXX");
Now: $con = mysql_connect("localhost","chrislynk_myuser","XXXXXXXX");

I canot say why <sqluser> failed but <accountuser>_<sqluser> works but gift horse and all.

I hope this hepls.
 

scipets2

New Member
Messages
28
Reaction score
1
Points
0
The file was included before and can I say again my site was working fine after the upgrade.
Edit:
PHP:
include('dbinfo.php');

mysql_connect($dbinf['host'], $dbinf['uname'], $dbinf['pword']);
@mysql_select_db($dbinf['dbase']) or die("Database Error,  Please try again later.");
That's the order
Edit:
Darn I was so stupid,
I have fixed the problem I must have removed
PHP:
$dbinf = getdbInf();
when I copied and pasted that script onto a different area of the site. Thanks for the help
 
Last edited:
Status
Not open for further replies.
Top