jeudi 16 juin 2016

mysql won't accept my password when using it as a regular user

When I try to deploy my app I get this error

Mysql2::Error: Access denied for user 'root'@'localhost' (using password: YES)

when I try to log in to sql as root it works

$ sudo mysql -u root -p

but when I try to log in as a normal user I get the error

$ mysql -u root -p
Enter password: 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

Why mysql root password works for system root but doesn't work for the systems regular user?

solution

answer to this question has helped to some extent

http://serverfault.com/questions/254629/unable-to-install-mysql-server-in-ubuntu

also I had to remove offending file from apparmor

Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ... AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'

So I had to run this command to get rid of the error. After that Mysql got instaled cleanly and I can log in as regular user.

rm /etc/apparmor.d/usr.sbin.mysqld

Aucun commentaire:

Enregistrer un commentaire