SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 52

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2008
    Location
    Dublin, Ireland.
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    #1045 - Access denied for user 'root'@'localhost' (using password: NO)

    Hi all.
    Not long at this. Yesterday I uninstalled wamp5 and installed latest wamp2. I entered password in sql console which it now accepts each time I log on to sql console. However when I try to access mysqladmin it returns:
    #1045 - Access denied for user 'root'@'localhost' (using password: NO)
    Any help much appreciated.
    Thanks and kind regards,
    Dermot.

  2. #2
    SitePoint Guru Ruben K.'s Avatar
    Join Date
    Jun 2005
    Location
    Alkmaar, The Netherlands
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't want to state the obvious but

    the login mysqladmin uses is wrong. it appears mysqladmin logs in using username 'root' and password '' (blank)


  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2008
    Location
    Dublin, Ireland.
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many thanks Ruben.
    When I first installed wamp2 I could access phpmyadmin. But once I created password in mysql console as it suggested I should for security reasons then phpmyadmin immediately hit me with above error.
    Do I need to reconfigure something somewhere?
    If so what and where?
    Sorry for being so slow.
    Kind regards,
    Dermot.

  4. #4
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    you have to specify the password in the config.inc.php file for phpmyadmin.

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2008
    Location
    Dublin, Ireland.
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many thanks fellas.
    Thanks to you things are swimming again and everything is rosy.
    And Longneck I've left a pint of Guinness for you at the bar!

    For any other fellow newbies here is the whole fix:-
    mysql>UPDATE mysql.user
    ->SET Password=PASSWORD("*******")
    ->WHERE User="root";
    mysql>FLUSH PRIVILEGES;

    This is from Sitepoint's "Build your own Database Driven Website using PHP and MYSQL"

    And then as Longneck said specify the password in the config.inc.php file for phpmyadmin.

    Kind regards,
    Dermot.

  6. #6
    SitePoint Addict bbparis's Avatar
    Join Date
    Aug 2008
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm just to confirm you that it's the solution.

    yesterday I tried to fix the problem, but the only think that was missing is the first line in MySQL command:

    UPDATE mysql.user

    I was writing ( UPDATE mysql ) : so please follow the next steps if you want to resolve your problem with ( #1045 - Access denied for user 'root'@'localhost' (using password: NO):

    1 : go to your WAMP icon on your PC desktop screen and LEFT CLICK to open the menu, you will see MYSQL folder, CLICK to see MYSQL CONSOLE, open it.

    2: now you have DOS screen ( a black screen ) :

    A: if you already set a password, type it
    B: if you did not do this step yet, write the following red text
    B1: use mysql; and click ENTER on your keyboard
    3: now write the following red text and click ENTER :

    UPDATE mysql.user
    ->SET Password=PASSWORD("*******")
    ->WHERE User="root";

    don't worry about this sign ( -> ) , because for example when you write ( UPDATE mysql.user ) and you click ENTER on your keyboard, a new line appear with this sign ( -> ), your command will execute when you write this sign ( ; ) at the end of your text and click ENTER.

    NOTE: replace the password ******* by your password.

    4: now write the following red text and click ENTER :

    FLUSH PRIVILEGES;

    5: and to exit the black DOS screen now, write exit and click enter.

    ------------------------- we are finished from MySQL now --------------

    6: go to WAMP folder ( open your My Computer, click on C driver, and you will see WAMP folder ), click on APPS folder, and than click on your PHPMYADMIN folder ( e.g my folder called phpmyadmin2.11.6 ) and find the config.inc.php

    7: open config.inc.php and find the following orange text:

    $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed

    and add your password now that you used in step number 3 like that :

    [COLOR="rgb(255, 140, 0)"]$cfg['Servers'][$i]['password'] = 'yourpasswordhere'; // MySQL password (only needed[/COLOR]

    8: now save this modification, and close config.inc.php

    9: go to your web browser and type the following link :

    http://localhost/phpmyadmin/

    and enjoy, this is what happened with me.

    NB: I wrote all this explications, because I'm also learning PHP and I found a lot on this website helped me, so I'm trying also to help you.

  7. #7
    SitePoint Member
    Join Date
    Feb 2010
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Quote Originally Posted by bbparis View Post
    I'm just to confirm you that it's the solution.

    yesterday I tried to fix the problem, but the only think that was missing is the first line in MySQL command:

    UPDATE mysql.user

    I was writing ( UPDATE mysql ) : so please follow the next steps if you want to resolve your problem with ( #1045 - Access denied for user 'root'@'localhost' (using password: NO):

    1 : go to your WAMP icon on your PC desktop screen and LEFT CLICK to open the menu, you will see MYSQL folder, CLICK to see MYSQL CONSOLE, open it.

    2: now you have DOS screen ( a black screen ) :

    A: if you already set a password, type it
    B: if you did not do this step yet, write the following red text
    B1: use mysql; and click ENTER on your keyboard
    3: now write the following red text and click ENTER :

    UPDATE mysql.user
    ->SET Password=PASSWORD("*******")
    ->WHERE User="root";

    don't worry about this sign ( -> ) , because for example when you write ( UPDATE mysql.user ) and you click ENTER on your keyboard, a new line appear with this sign ( -> ), your command will execute when you write this sign ( ; ) at the end of your text and click ENTER.

    NOTE: replace the password ******* by your password.

    4: now write the following red text and click ENTER :

    FLUSH PRIVILEGES;

    5: and to exit the black DOS screen now, write exit and click enter.

    ------------------------- we are finished from MySQL now --------------

    6: go to WAMP folder ( open your My Computer, click on C driver, and you will see WAMP folder ), click on APPS folder, and than click on your PHPMYADMIN folder ( e.g my folder called phpmyadmin2.11.6 ) and find the config.inc.php

    7: open config.inc.php and find the following orange text:

    $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed

    and add your password now that you used in step number 3 like that :

    [COLOR="rgb(255, 140, 0)"]$cfg['Servers'][$i]['password'] = 'yourpasswordhere'; // MySQL password (only needed[/COLOR]

    8: now save this modification, and close config.inc.php

    9: go to your web browser and type the following link :

    and enjoy, this is what happened with me.

    NB: I wrote all this explications, because I'm also learning PHP and I found a lot on this website helped me, so I'm trying also to help you.
    Hi bbparis,

    Thank u very much for ur post at (sitepoint on Aug 2008) regarding PHPMyadmin problem.
    I have problem with PHPMyadmin (Wamp). Though i tried a lot from others suggestions,
    but it wasn't fixed my problem.
    I tried ur solution. It works.
    Though im not at all registered user in it. So I registered myself to say thanks to u.
    Im very grateful to ur valueable & detailed suggestion.

    Once again thanks a lot.
    Shall i ask u, if i got any other doubt in PHP?

    Regards,
    Vanash

  8. #8
    SitePoint Member
    Join Date
    May 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi I am a PHP novice here. I have the same problem as well. On your step 2. I suppose to have a blank screen (DOS), I didn't have a blank screen. I have this line, enter your password. What password is it asking here?
    I don't have a password for my user account and the PHPmyAdmin installation. So I am puzzled here.



    Quote Originally Posted by bbparis View Post
    I'm just to confirm you that it's the solution.

    yesterday I tried to fix the problem, but the only think that was missing is the first line in MySQL command:

    UPDATE mysql.user

    I was writing ( UPDATE mysql ) : so please follow the next steps if you want to resolve your problem with ( #1045 - Access denied for user 'root'@'localhost' (using password: NO):

    1 : go to your WAMP icon on your PC desktop screen and LEFT CLICK to open the menu, you will see MYSQL folder, CLICK to see MYSQL CONSOLE, open it.

    2: now you have DOS screen ( a black screen ) :

    A: if you already set a password, type it
    B: if you did not do this step yet, write the following red text
    B1: use mysql; and click ENTER on your keyboard
    3: now write the following red text and click ENTER :

    UPDATE mysql.user
    ->SET Password=PASSWORD("*******")
    ->WHERE User="root";

    don't worry about this sign ( -> ) , because for example when you write ( UPDATE mysql.user ) and you click ENTER on your keyboard, a new line appear with this sign ( -> ), your command will execute when you write this sign ( ; ) at the end of your text and click ENTER.

    NOTE: replace the password ******* by your password.

    4: now write the following red text and click ENTER :

    FLUSH PRIVILEGES;

    5: and to exit the black DOS screen now, write exit and click enter.

    ------------------------- we are finished from MySQL now --------------

    6: go to WAMP folder ( open your My Computer, click on C driver, and you will see WAMP folder ), click on APPS folder, and than click on your PHPMYADMIN folder ( e.g my folder called phpmyadmin2.11.6 ) and find the config.inc.php

    7: open config.inc.php and find the following orange text:

    $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed

    and add your password now that you used in step number 3 like that :

    [COLOR="rgb(255, 140, 0)"]$cfg['Servers'][$i]['password'] = 'yourpasswordhere'; // MySQL password (only needed[/COLOR]

    8: now save this modification, and close config.inc.php

    9: go to your web browser and type the following link :

    http://localhost/phpmyadmin/

    and enjoy, this is what happened with me.

    NB: I wrote all this explications, because I'm also learning PHP and I found a lot on this website helped me, so I'm trying also to help you.

  9. #9
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In config.inc.php I not have orange text:
    $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
    my config.inc.php http://a.imageshack.us/img291/7757/g...0725130641.jpg

    when start http://localhost/phpmyadmin/ not ask for password.

    In localhost/phpmyadmin-Privilegs indicates that the password was set http://a.imageshack.us/img291/3189/g...0725130442.jpg
    I do not understand what it means yellow note at the bottom.

    I clear Recent History

  10. #10
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    I'm writing with the assumption that u have already set the password for ur root folder on xampp or wamp

    Jusr use 'root' as ur username for phpmyadmin, n not the username u used for the root folder.
    But for the password field, use the password u set for ur root folder.

    Hope this wud help

  11. #11
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi guys

    i did exactly what you suggested, even more than once, and nothing changes. and i didn't make such big changes in the phpmyadmin. right after i got that message i went to the forum and tried the solution quoted. please help me my site and database are closed for me....

    thank you

  12. #12
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation

    Thanks for providing the solution to the problem bbparis - it worked fine for me.

    However, in my opinion, writing the root password in a config.inc.php file appears to be a big security flaw. Surely, it now makes it easy for hackers to go and read your root password very easily.

    Is there a way of making it more secure?

  13. #13
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have done that, but still ERROR POPS UP...

    ..UNTIL..

    ..CLEAR THOSE CACHE & COOKIES & RECENT HISTORY OF YOUR BROWSER. THEN MyPHPADMIN WILL RETRIEVE FROM YOUR SETTINGS CONFIG FILE AND WILL BE BACK TO NORMAL INSTEAD FROM CACHE.

    It takes the damn one whole day for me to figure this very simple solution step.

  14. #14
    SitePoint Member
    Join Date
    Nov 2010
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't understand, all that happens when I go to 'console' is I get prompted for a password and when I try plugging it in, the machine beeps loudly and it disappears. I must be missing something in the process. I don't care about adding a password; I just want the myphpadmin to show the database. I had to reload wamp on another drive becuase things got so badly screwed up on the c and I ended up having to unistall it. Now I'm at square one again but experiencing the same error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)

  15. #15
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    1,963
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by quicksand View Post
    I don't understand, all that happens when I go to 'console' is I get prompted for a password and when I try plugging it in, the machine beeps loudly and it disappears. I must be missing something in the process. I don't care about adding a password; I just want the myphpadmin to show the database. I had to reload wamp on another drive becuase things got so badly screwed up on the c and I ended up having to unistall it. Now I'm at square one again but experiencing the same error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
    Don't use the ; behind the password

  16. #16
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bbparis View Post
    I'm just to confirm you that it's the solution.

    yesterday I tried to fix the problem, but the only think that was missing is the first line in MySQL command:

    UPDATE mysql.user

    I was writing ( UPDATE mysql ) : so please follow the next steps if you want to resolve your problem with ( #1045 - Access denied for user 'root'@'localhost' (using password: NO):

    1 : go to your WAMP icon on your PC desktop screen and LEFT CLICK to open the menu, you will see MYSQL folder, CLICK to see MYSQL CONSOLE, open it.

    2: now you have DOS screen ( a black screen ) :

    A: if you already set a password, type it
    B: if you did not do this step yet, write the following red text
    B1: use mysql; and click ENTER on your keyboard
    3: now write the following red text and click ENTER :

    UPDATE mysql.user
    ->SET Password=PASSWORD("*******")
    ->WHERE User="root";

    don't worry about this sign ( -> ) , because for example when you write ( UPDATE mysql.user ) and you click ENTER on your keyboard, a new line appear with this sign ( -> ), your command will execute when you write this sign ( ; ) at the end of your text and click ENTER.

    NOTE: replace the password ******* by your password.

    4: now write the following red text and click ENTER :

    FLUSH PRIVILEGES;

    5: and to exit the black DOS screen now, write exit and click enter.

    ------------------------- we are finished from MySQL now --------------

    6: go to WAMP folder ( open your My Computer, click on C driver, and you will see WAMP folder ), click on APPS folder, and than click on your PHPMYADMIN folder ( e.g my folder called phpmyadmin2.11.6 ) and find the config.inc.php

    7: open config.inc.php and find the following orange text:

    $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed

    and add your password now that you used in step number 3 like that :

    [COLOR="rgb(255, 140, 0)"]$cfg['Servers'][$i]['password'] = 'yourpasswordhere'; // MySQL password (only needed[/COLOR]

    8: now save this modification, and close config.inc.php

    9: go to your web browser and type the following link :

    http://localhost/phpmyadmin/

    and enjoy, this is what happened with me.

    NB: I wrote all this explications, because I'm also learning PHP and I found a lot on this website helped me, so I'm trying also to help you.

    Thank you. Your step by step explanation was too easy for any newbie like me to follow. Cheers mate

  17. #17
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    I've got the error #1045 when i try to access phpmyadmin ...
    So, I've already had an Wamp installed on my computer one year ago, since that, i deleted it, and few days ago, i installed the new version (2.2a).
    So I've got the problem you said, but when i go to the mySQL console, i've got the message to enter the password, and I don't remember him (I don't even know if I put it in) !
    So after that, I uninstalled WampServer, delete the wamp folder, reboot my computer, and re-install WampServer2.2a but still password needed !!

    What should I do ?

    I went to the my.ini file and uncomment the password section and put mine :
    Code:
    # The following options will be passed to all MySQL clients
    [client]
    password	= test
    port		= 3306
    socket		= /tmp/mysql.sock
    Then i restart all services, try to enter mySQL console with that password, no changes.


    Other problem, the icon for Wamp stay orange (even if I put him online), what does that mean ?

    Thanks.

  18. #18
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for me the error still show up guys help....

    this part
    $cfg['Servers'][$i]['AllowNoPasswordRoot'] = false;

    was set to true instead of false and was cuasing the error
    on the config.inc.php

  19. #19
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by derm w View Post
    Many thanks fellas.
    Thanks to you things are swimming again and everything is rosy.
    And Longneck I've left a pint of Guinness for you at the bar!

    For any other fellow newbies here is the whole fix:-
    mysql>UPDATE mysql.user
    ->SET Password=PASSWORD("*******")
    ->WHERE User="root";
    mysql>FLUSH PRIVILEGES;

    This is from Sitepoint's "Build your own Database Driven Website using PHP and MYSQL"

    And then as Longneck said specify the password in the config.inc.php file for phpmyadmin.

    Kind regards,
    Dermot.


    I just registered to say thank you. My issue is resolved.

  20. #20
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ya I closed it and tried it again and now it is a white page again and says done. I don't understand that. :-( I will try firefox. :-D

  21. #21
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a blog with all the issues I was having on it, but I can't post it since I am new to the forum. I am going to just copy and paste my issues. Sorry....I know most of it doesn't matter anymore since I am not having the issue, but maybe it would be helpful information. I am also sorry for so many replies. I kept thinking of things to say. Thanks!

    taraleedesignsblog
    blogspot
    com....I can't post links, so I figure you can assume what this is maybe....sorry :-S....just when I hit enter from taraleedesignsblog to com put a dot between them haha thanks! Sorry ohhh and I tried it in firefox and it works everytime, so it must be something with IE....So I got it working!!!

    SQL Errors
    I am unsuccesfull logging into sql database when trying to instal. The installation fails on the security. It says I may have a firewall blocking it. I turned it off and still no luck and my phpmyadmin will not login. Althought it logged in one time after I first installed it. Here is my error. If you have any information on how I could fix this issue, it would be greatly appreciated.

    phpmyadmin error:

    Error Number 1045.
    Access denied for user 'root'@'localhost' (using password:NO)

    SQL installation error:

    MySQL Server Instance Configuration Wizard
    MySQL Server Instance Configuration
    Configure the MySQL Server 4.1 server instance.
    Processing configuration...

    / Prepare configuration
    / Write configuration file (c:\Program ... \my.ini)
    / Start service
    x Apply Security settings

    The security settings could not be applied.

    This is what happens when I try password fix:

    After the configuration wizard locks up by giving me error:1045, I start the MySQL command
    line client and press ENTER when asked for a password, but the command line client exits
    on me.

    Now getting a white page on phpmyadmin that just says done and the wizzard says service can not be started on the restart service step

    Now getting...#1045 - Access denied for user 'root'@'localhost' (using password: YES)

  22. #22
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I have a new question.......

    I was able to get into this page.....localhost/administrator/ It was to get into this joomla that I was told about, but now that doesn't work, but it did before I messed with any settings to get phpmyadmin to work. Which doesn't make sense to me because the config file is in the phpmyadmin folder which is in a different folder. It is all in the wamp folder, but ok.....here is what I mean.

    Path for admin folder:

    C:\wamp\www

    Path for phpmyadmin config file:

    C:\wamp\apps\phpmyadmin3.2.0.1

    The error it gives me when I try to go to localhost/administrator/ is.... Database Error: Unable to connect to the database:Could not connect to MySQL

    Do you know how I could fix this? It used to ask me for my login and I would enter it and I was in, but now it doesn't. :-( Thanks for any info!

  23. #23
    SitePoint Addict bbparis's Avatar
    Join Date
    Aug 2008
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello, I read your posts from my iPhone, I will send your my reply with some solutions from office during the day, can you please tell me which version of php you have ?

  24. #24
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php 5.3.0

    I think I messed it up....I was trying to figure out why I could not get into joomla admin page now getting the database error and was messing with my phpmyadmin priviliages and i change some but then I clicked something to set them back to the defaults and now I can't get into phpmyadmin again... :-( It's ok no hurry. It jus frustrating, but I am sure I will get it! Thanks so much!

    I am getting this error now for my phpmyadmin:

    #1045 - Access denied for user 'root'@'localhost' (using password: YES)

    and for my localhost/adminitrator I get:

    Database Error: Unable to connect to the database:Could not connect to MySQL

    Thanks again!

  25. #25
    SitePoint Member
    Join Date
    Nov 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my config.inc for phpmyadmin:
    -this is how it was when it was working earlier

    <?php

    /* Servers configuration */
    $i = 0;

    /* Server: localhost [1] */
    $i++;
    $cfg['Servers'][$i]['verbose'] = 'localhost';
    $cfg['Servers'][$i]['host'] = 'localhost';
    $cfg['Servers'][$i]['port'] = '3307';//I had changed it I think when I set it up I can change it back to 3306. I don't think its making a difference for me anyway.
    $cfg['Servers'][$i]['socket'] = '';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = 'mypassword';
    $cfg['Servers'][$i]['AllowNoPassword'] = false;

    /* End of servers configuration */

    $cfg['DefaultLang'] = 'en-utf-8';
    $cfg['ServerDefault'] = 1;
    $cfg['UploadDir'] = '';
    $cfg['SaveDir'] = '';

    ?>


Bookmarks

Posting Permissions

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