user1814475
user1814475

Reputation: 11

I can't access mysql ERROR: 1045(28000)

I had installed lamp server in my Ubuntu 12.04 box when I tried to access MySQL I got this bug ERROR 1045(28000) I tried many solution available in the internet nothing works. These are all my bash scripts I had tried to access it :

root@sampath-codyowl:~# mysql -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
root@sampath-codyowl:~# mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Upvotes: 1

Views: 1842

Answers (1)

Ilan Frumer
Ilan Frumer

Reputation: 32367

First try this

mysql -h 127.0.0.1 -u root -p

If that worked then add root@localhost

GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'root-password' WITH GRANT OPTION;

Other reasons:

  • Check if there is a firewall blocking your mysql port(mysql default is 3306)
  • Make sure that the server has not been configured to ignore network connections. look for --skip-networking, or --bind-address flags.
  • Check this article : http://dev.mysql.com/doc/refman/5.0/en/access-denied.html

Upvotes: 1

Related Questions