Access denied for user 'root'@'localhost'
In the afternoon I installed MySQL according to notes I had taken the previous time. When I ran
mysql_secure_installation
I discovered I had to use sudo
. I thought I had forgotten to write
this down. Next I tried to connect to the MySQL server as follows:
mysql -uroot -p
But I got an error: "ERROR 1698 (28000): Access denied for user
'root'@'localhost'". After some Googling I learnt that the security
model in MySQL 5.7 has changed and that sudo
is required if you want
to login as user root
.