Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Could not connect: Access denied for user 'root'@'localhost'
#1
Quote:Could not connect: Access denied for user 'root'@'localhost' (using password: YES)

This error is from

Code:
mysql_connect("localhost", "root", "dog")

I'm not using the password "YES". Anyone know what's up?

This is from the config.inc.php

Code:
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'dog';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Reply
#2
Try 127.0.0.1

And your password might be wrong.
Superman I am here to rescue you.
This is Support Forums not Support PMs.  Do not PM me for support unless it's private and site related.
Reply
#3
(02-03-2011, 03:22 PM)Omniscient Wrote: Try 127.0.0.1

And your password might be wrong.

I tried 127.0.0.1 and got the same error. How would my password be wrong if in my config file it says that it is dog?
Reply
#4
If you could post the part of the code which is connecting to the database, it could be something wrong in that code.
Are you using a already written code, or are you writting the code?
Just a thought, but are you sure that the database has a password!
Reply
#5
(02-03-2011, 04:16 PM)Gaijin Wrote: If you could post the part of the code which is connecting to the database, it could be something wrong in that code.
Are you using a already written code, or are you writting the code?
Just a thought, but are you sure that the database has a password!

Yep, it doesn't have a password. Thanks
Reply
#6
(02-03-2011, 04:47 PM)nevets04 Wrote: Yep, it doesn't have a password. Thanks
Glad I could Help! ;)

I did the same mistake couple of times when I started with MySQL.... Big Grin
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  User Management Script - User Cake Support 9 5,623 05-13-2010, 03:21 PM
Last Post: Julie
  User Access Levels Dutchcoffee 2 1,039 01-11-2010, 11:30 PM
Last Post: Gaijin
  Connect IRC using php on linux systems immi 12 4,113 10-28-2009, 06:02 AM
Last Post: manipulate

Forum Jump:


Users browsing this thread: 4 Guest(s)