Skip to main content

Posts

Showing posts from January, 2014

Solve MYSQL Error 1045 (28000): Access denied

Most of mysql users will face with a login error, when they try to login with another user name into mysql db on localhost. I am one of them. Typically, these commands are run: > GRANT ALL ON *.* TO 'fatih'@'%' IDENTIFIED BY 'istanbul'; > quit; Then, we try ' mysql -u fatih -p ' . This ends with an error : ' ERROR 1045 (28000): Access denied for user 'fatih'@'localhost' (using password: YES) '   It doesn't seem reasonable at first look and to figure what is going on out, passwords and grants are usually checked as first action. However, both will not work, because granted from '%' behaves unexpectedly if you try to login a mysql db in your computer. Since localhost is resolved to 127.0.0.1 in /etc/hosts file, mysql interprets the login attempt from user 'fatih' as fatih@localhost which doesn't have permission to authenticate. There are two ways to handle this issue. Specify another ip ad