+ Post New Thread
Page 1 of 3 123 LastLast
Results 1 to 15 of 34
Web Development Thread, 1045 - Access denied for user 'root'@'localhost' (using password: NO – phpmyadmin in Coding and Web Development; ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465

    1045 - Access denied for user 'root'@'localhost' (using password: NO – phpmyadmin

    Hi

    I have googled this error message and to be honest I don’t understand a word of it. I get this when I try and gain access to phpmyadmin I was wondering if someone can help please?

    Cheers

    Z

  2. #2

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    Boston, MA
    Posts
    7,597
    Thank Post
    109
    Thanked 770 Times in 598 Posts
    Rep Power
    183
    Looks like your password for MySQL is wrong (well... it isn't there!)

  3. #3
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63
    If i remeber this error from when I ran into it phpmyadmin will not let you connect if you don't have a password set.

    Check the config.php file for what you need to do, the file is fully commented

  4. #4


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,701
    Thank Post
    352
    Thanked 805 Times in 720 Posts
    Rep Power
    348
    It means you haven't specified a password AT ALL for the user root, its not that its incorrect.

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    This is my config file, the correct password is there.

    <?php
    /*
    * Generated configuration file
    * Generated by: phpMyAdmin 2.11.7 setup script by Michal ÄŒihaÅ™ <michal@cihar.com>
    * Version: $Id: setup.php 10748 2007-10-10 07:30:59Z cybot_tm $
    * Date: Mon, 14 Jul 2008 21:56:49 GMT
    */

    /* Servers configuration */
    $i = 0;

    /* Server localhost (config:root) [1] */
    $i++;
    $cfg['Servers'][$i]['host'] = 'localhost';
    $cfg['Servers'][$i]['extension'] = 'mysql';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['controluser'] = 'root';
    $cfg['Servers'][$i]['controlpass'] = 'password';
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = 'password';

    /* End of servers configuration */

    ?>
    Thanks for the help

  6. #6
    tomscaper's Avatar
    Join Date
    Jul 2006
    Posts
    814
    Thank Post
    118
    Thanked 29 Times in 15 Posts
    Rep Power
    22
    I remember trying to figure that one out for ages when i was playing around with php, mysql. Couldnt remember exactly where it all was.

  7. #7


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,701
    Thank Post
    352
    Thanked 805 Times in 720 Posts
    Rep Power
    348
    I use authtype Cookie rather than embed the password into the config thus allowing effectively anybody to get on as root.

    By using cookie, it will prompt you for a login.

  8. #8
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63
    I would assume that when you installed mySQL on the windows box you specified an admin password and did not leave it empty, if you did supply one then it could be the old password bug.

    I'll dig out my how too and post it up just incase.

  9. #9
    ICTNUT's Avatar
    Join Date
    Jul 2005
    Location
    Hereford
    Posts
    1,419
    Thank Post
    196
    Thanked 249 Times in 122 Posts
    Rep Power
    63
    What mysql client are you using to connect to the mysql database?

    You may need to tell the mysql client to ask for a password by using the -p command:


    mysql -u root -p -h localhost
    You could also try and reset the root password:

    MySQL :: MySQL 5.0 Reference Manual :: 12.5.1.6 SET PASSWORD Syntax

    I quote from the above document:

    Note

    If you are connecting to a MySQL 4.1 or later server using a pre-4.1 client program, do not use the preceding SET PASSWORD or UPDATE statement without reading Section 5.4.8, “Password Hashing as of MySQL 4.1”, first. The password format changed in MySQL 4.1, and under certain circumstances it is possible that if you change your password, you might not be able to connect to the server afterward.
    This was the exact problem I had.....

  10. #10

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    Quote Originally Posted by ICTNUT View Post
    I would assume that when you installed mySQL on the windows box you specified an admin password and did not leave it empty, if you did supply one then it could be the old password bug.

    I'll dig out my how too and post it up just incase.
    It didnt ask for one

    Quote Originally Posted by ICTNUT View Post
    What mysql client are you using to connect to the mysql database?
    I am using:

    MySql: 5.1
    PhpMyAdmin: 2.11.7

    You could also try and reset the root password:
    I have tried changing the password by using the MySQL Server Instance Config Wizard

    You may need to tell the mysql client to ask for a password by using the -p command:
    when i do that i get the attached
    Attached Images Attached Images
    Last edited by FN-GM; 15th July 2008 at 10:23 AM.

  11. #11


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,701
    Thank Post
    352
    Thanked 805 Times in 720 Posts
    Rep Power
    348
    Come out of the MySQL shell and at a normal command prompt put in:

    mysql -u root -p
    and press enter - If it asks for a password, put it in.

    If it DOESN'T, this means you need to set one using the following syntax (again outside of the MySQL Shell).

    mysqladmin -u root password "mypasswordr0x"
    Then use this password in your phpmyadmin config and change the auth type to cookie.

    Should resolve all of the issues you've outlined.

  12. #12

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    Quote Originally Posted by kmount View Post
    Come out of the MySQL shell and at a normal command prompt put in:

    and press enter - If it asks for a password, put it in.

    Hi thanks for the help.

    I put the password in then got the attached.
    Attached Images Attached Images

  13. #13

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,867
    Thank Post
    412
    Thanked 778 Times in 651 Posts
    Rep Power
    182
    Did you remember to rename the sample config.php.dist to config.php, if you used it as a base?

  14. #14


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,701
    Thank Post
    352
    Thanked 805 Times in 720 Posts
    Rep Power
    348
    OK, so based on that, you need to edit the config file with phpmyadmin and set the auth type to "cookie", don't bother putting in a password as it won't be read.

    Then visit it and it should prompt you for credentials.

  15. #15

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,302
    Thank Post
    900
    Thanked 1,794 Times in 1,545 Posts
    Blog Entries
    12
    Rep Power
    465
    Quote Originally Posted by powdarrmonkey View Post
    Did you remember to rename the sample config.php.dist to config.php, if you used it as a base?
    i dont seem to have that file

    Quote Originally Posted by kmount View Post
    OK, so based on that, you need to edit the config file with phpmyadmin and set the auth type to "cookie", don't bother putting in a password as it won't be read.

    Then visit it and it should prompt you for credentials.
    thanks but i have done that still no joy

    Thanks allot

    Z
    Last edited by FN-GM; 15th July 2008 at 01:53 PM.



SHARE:
+ Post New Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. New user denied access- permission prob?
    By dave.81 in forum Windows
    Replies: 5
    Last Post: 17th January 2008, 03:44 PM
  2. Access Denied - File in Explorer
    By Simcfc73 in forum Windows
    Replies: 4
    Last Post: 10th January 2008, 11:19 AM
  3. Replies: 8
    Last Post: 13th October 2007, 02:05 PM
  4. MySQL Password Problem
    By Ric_ in forum *nix
    Replies: 4
    Last Post: 13th September 2007, 12:28 PM
  5. Now they want my server root password.
    By tickmike in forum General Chat
    Replies: 29
    Last Post: 10th September 2006, 12:23 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •