Jump to content

[Solved] Mysql problem


zizuno

Recommended Posts

I have tried all combinations of connecting to my database.

 

Access denied for user 'zizuno'@'localhost' (using password: NO)

 

<?php


$server = 'localhost';
$user = 'zizuno_test';
$pass = '***';

$db = mysql_connect($server,$user,$pass) or die(mysql_error());
mysql_select_db("zizuno_test") or die(mysql_error());

?>

 

I created user test for database test, still doesn't work. I am using this code in an include.

Link to comment
Share on other sites

Hi, Zizuno.

 

I am not an admin, and my expertise is not in MySQL. However, I dealt with it a few times in the past.

 

What I've found is that problems will appear as soon as we forget-add something silly.

 

I noticed your error message ends with '(using password: NO)', but in your code you have a line for a password '$pass = '***';'. If I am right, I think either the password most be omitted if it's void, or at least the statement should be for an empty password ($pass = '';).

 

Or you may need to create the password for the database. It could also be interesting if you posted the other ways that did not work before.

 

Best regards,

 

Bad Wolf.

 

Ps: the admin may have another opinion... I would like to see how your problem gets resolved :D

Link to comment
Share on other sites

Funny thing is, my user is already part of the database. I made sure of that before I posted. This is what my page looks like.

 

http://img442.imageshack.us/img442/403/scr...anelxmozill.png

 

I know the username is different, it is because I deleted the other test just to make sure I didn't screw anything up. I cannot connect to my test nor my main database.

Link to comment
Share on other sites

Why don't you try changing your script from storing the username, etc in variables to passing them directly to the mysql_connect function. The error message you report indicates that no password is provided to use when connecting.

 

$con = mysql_connect("localhost", "myusername", "password123");

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...