0

i'm struggling with a shiny new ubuntu server. My MySQL root password is not working and I cannot change it. What I've tried:

sudo service mysql stop
sudo mysqld_safe --skip-grant-tables &

mysql
use mysql;
UPDATE mysql.user SET authentication_string=PASSWORD('MYPASS') WHERE User='root';
FLUSH PRIVILEGES;
quit

sudo service mysql start

    mysql -u root -p
Enter password: 

    Access denied for user 'root'@'localhost'

I've also tried with mysql_secure_installation but the same as before

Some additional info

➜  ~ cat /etc/lsb-release     
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"

mysql  Ver 14.14

Even tried removing mysql-server and re installing

1
  • What version? (It is not 14.14_.)
    – Rick James
    Jul 17, 2019 at 23:46

1 Answer 1

0

For some reason I'm not sure about, the solution was:

sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypass';

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .