Reputation: 11
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
Reputation: 32367
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;
Upvotes: 1