zizuno Posted September 12, 2010 Posted September 12, 2010 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.
Bad Wolf Posted September 12, 2010 Posted September 12, 2010 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
Byron Posted September 12, 2010 Posted September 12, 2010 Go back to your cpanel MySQL Databases and Add User to Database: User: zizuno_test to Database: zizuno_test And you should be good to go.
zizuno Posted September 13, 2010 Author Posted September 13, 2010 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.
rvt Posted September 13, 2010 Posted September 13, 2010 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");
zizuno Posted September 13, 2010 Author Posted September 13, 2010 To no avail, that did not work. Edit: I installed SQLbuddy and was able to log into my usernames like that. So my passwords/usernames are not wrong.
Byron Posted September 13, 2010 Posted September 13, 2010 Well I know your script works because I checked it myself before I posted. Go ahead and post your username and domain name and I'll escalate this to djbob.
zizuno Posted September 13, 2010 Author Posted September 13, 2010 Username of my account: zizuno Domain: ronsblog.co.cc Edit: Thanks for the attempted help
Wizard Posted September 13, 2010 Posted September 13, 2010 This support request is being escalated to our root admin.
Ashoat Posted September 13, 2010 Posted September 13, 2010 Where is your test script located on disk?
zizuno Posted September 13, 2010 Author Posted September 13, 2010 /www/actions/db.php Then in my /www/blog/ I use include '../actions/db.php';
Byron Posted September 13, 2010 Posted September 13, 2010 Your showing a syntax error in this file here: /www/actions/db.php http://ronsblog.co.cc/actions/db.php Try correcting it and see what happens.
zizuno Posted September 13, 2010 Author Posted September 13, 2010 Thanks for the help. Don't see how it skipped by me.
Recommended Posts