Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012

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

    Yesterday I got into mysql using

    sudo mysql -u root mysql -pkoenyn676

    my question is why is mysql being used twice I mean why does the line say root AND mysql after it, i mean i know the first mysql is for the prog to run but...

    that worked yesterday but today it doesn't work and I get

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    Ive tried and tried, I even went so far to kill the catenation of

    and creating an initialization file (mysql-init) where I reset the password by saying:

    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');

    ('ve also done it for the user mysql@localhost but it also doesn't work)

    then mysqld_safe --init-file=~/mysql-init & to run that initialization file

    and it either says again, access denied, OR when in sudo i do it, it says theres already a mysqld process running and then it hangs

    so now I'm trying to kill the pid of the mysqld process but it isn't dying
    it seems to reassign a new value to itself since when I do ps -ef it pops up again on the list, so the
    mysqld_safe --init-file=~/mysql-init & when done with sudo or in sudo bash

    is giving me a mysqld process already running and then just hangs not going any further.

    So I can't log into mysql AT ALL in the command prompt and I'm stuck at this juncture.

    What am I to do? I'm a total noob with linux and mysql although my dad is a computer science lecturer and he can't even help me with this, I'm kinda familiar with working in a prompt environment but I really don't know how to solve this... I've been stuck the whole day on this trying to get into mysql shell/ command prompt
    ... I got in there yesterday but something changed in the meantime

    but what? I honestly don't know. Somehwere I think i accidentally changed the host no. to or but when I try and grep for it
    the comp doesn't find it in any file but I remember typing that mistake somewhere would it make a difference. What's changed since yesterday? I can't figure this one out...
    I've gotten phpmyadmin to start but I can't log in there bceause of this problem.

  2. #2
    Join Date
    Sep 2009
    San Sebastian, Spain
    Firstly I am not sure where you got the instructions to use:

    sudo mysql -u root mysql -pkoenyn676

    in order to connect to the database. It should definitely not have the second mysql:

    sudo mysql -u root -pkoenyn676

    At this point with all the changes you have done you would be better to de-install and re-install mysql.

    Alternatively if you would prefer to work on figuring this one out, then I suggest looking at this video which shows you how to reset the password. Also when trying to kill the process have a look at the process ID of the mysql process and also look to see if any other process has as its parent process id (PPID) with the same number. This process is controlling managing the mysql process and anytime it sees that it has died it is automatically restarting the process. Hence you PID changing each time after killing it. The important file for configuration mysql is typically found in /etc/my.cnf

    Hope this helps?
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    Follow me on Twitter

  3. #3
    Join Date
    May 2012

    sort of not really but lol i got in

    hi i got into mysql in my other install so atm im not worrying but your totally right about de installing it but I can't manage that at the moment though i used the package manager to supposedly remove it its still there.

    But thanks for the help though, that bit on ppid i didn't know that.
    i just log in using mysql -u whatever -p and it works

    but Im curious as to why theres no mysqld.sock file there and that was before i even tried to remove mysql with the software manager, its just not on my linuxmint install, which is where my mysql problems are.

    but in my karmic koala mysql is just fine.
    thanks tho... reinstall after de installing is the best option but i couldnt manage it, so im staying in my koala using mysql.

Posting Permissions

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