PDA

View Full Version : [SOLVED] mysql can't log in



Mr.Dee
August 22nd, 2012, 04:48 PM
$ mysql -p -u root
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


Not sure what I'm doing wrong. My google-fu may be too week:
http://dev.mysql.com/doc/refman/5.1/en/access-denied.html

Mr.Dee
August 22nd, 2012, 06:00 PM
mysqld_safe --skip-grant-tables

That worked for me, but now it seems i don't need a password...

Bachstelze
August 22nd, 2012, 06:27 PM
What exactly do you want to do? Have you set an initial root password? If you re using Ubuntu, you have been prompted for one in the debconf screen after you installed mysql.

rukiaEnix
August 22nd, 2012, 06:32 PM
Or maybe the root user is not allow to start a session.

Mr.Dee
August 22nd, 2012, 06:44 PM
Running Linux Mint. Can't remember if I created a password. I installed by ...



sudo apt-get install mysql-server

Bachstelze
August 22nd, 2012, 06:49 PM
Try


sudo dpkg-reconfigure mysql-server-5.5

Or whatever your mysql version is. Don't do it on the mysql-server metapackage, it will not work.

Mr.Dee
August 22nd, 2012, 07:00 PM
Try


sudo dpkg-reconfigure mysql-server-5.5

Or whatever your mysql version is. Don't do it on the mysql-server metapackage, it will not work.

WORKED!!! next round of beer is on me! Thanks to all.

rukiaEnix
August 22nd, 2012, 07:02 PM
Well, let's wait for that beer, I'll join if it happens even though I didn't help xD but don't worry I'll pay my own beer xD

BadB77
November 16th, 2012, 02:36 AM
wow! it also worked for me - my very same problems started when I upgraded from Lucid to 12.04. I started receiving Access denied, spent a week trying to fix it... 3306 was open (terminal connection was accepted), iptables showed the port was also fine. mysqladmin was also returning access denied etc.

Reinstallation (autoremove/autoclean/using software center) did not work as well... I tried all "default" pwds I could think of...

mysqld_safe --skip-grant-tables did not work btw too, so I rm'ed the file manually....

and smth from the above worked... one weird thing though...after all remove/autoclean/rm's I still after re-installation (when I got access to my db's) I see my older db's...

not sure if it's feature or a bug....