MySQL Forums
Forum List  »  Install & Repo

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Posted by: William Dodds
Date: May 20, 2012 08:23AM

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.

Options: ReplyQuote

Written By
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
May 20, 2012 08:23AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.