ERROR 1698 (28000): Access denied for user root

This problem occurs from the mysql versions 5.7.+ on wards.
ERROR 1698 (28000): Access denied for user ‘root’@’localhost’.

1. It is because MySql 5.7 by default allow to connect with socket, which means you just connect with sudo mysql

use mysql;

2. Run the following select statement:

SELECT user,authentication_string,plugin,host FROM mysql.user;

Continue reading ERROR 1698 (28000): Access denied for user root