tl;dr Comment out skip-name-resolve = 1
from /etc/mysql/my.cnf
and restart the database
I prefer to use a GUI MySQL client like Sequel Pro for doing database tasks. With EasyEngine 3 connecting to my database over SSH worked right out of the box. With a fresh install using WordOps I kept getting a MySQL said: Access denied for user 'username'@'127.0.0.1' (using password: YES)
even after double checking that the credentials were correct.
I thought this was odd so I logged in to my server and tried connecting to the database using the command line:
ubuntu@root:~$ mysql -u <username> --password <database-name> -h 127.0.0.1
Enter password:
ERROR 1045 (28000): Access denied for user '<username>'@'127.0.0.1' (using password: YES)
Same thing. Didn't work. I then changed the host 127.0.0.1
to localhost
ubuntu@root:~$ mysql -u <username> --password <database-name> -h localhost
MariaDB [<username>]>
That worked!
In Sequel Pro I tried entering the MySQL Host as localhost
but Sequel Pro kept changing it to 127.0.0.1
https://cloudup.com/cTWVslzC0cR Apparently localhost
is for local socket connections and 127.0.0.1
is for TCP connections (See https://github.com/sequelpro/sequelpro/issues/1146).
After comparing /etc/mysql/my.cnf
from EasyEngine v3 and WordOps I noticed WordOps had skip-name-resolve = 1
set. I commented that line out, restarted MySQL (wo stack restart --mysql
) and then I could connect using Sequel Pro.
Hopefully that helps someone else out.