I am trying to reset the root password following MysqlPasswordReset but when I try to start the server with --skip-grant-tables the server doesn\'t start
For Ubuntu 19 with MySQL 8.0.17-0ubuntu2, what ended up working for me was a combination of many answers:
In the MySQL's configuration file (/etc/mysql/mysql.conf.d/mysqld.cnf on my machine), under [mysqld], add:
skip-grant-tables = 1
plugin-load-add = auth_socket.so
Restart the MySQL Service;
Connect to MySQL: mysql -uroot;
Run:
UPDATE mysql.user SET authentication_string=null WHERE User='root'; FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pass123';
Stop MySQL and comment skip-grant-tables in the configuration file;
Start MySQL again and this should now work: mysql -u root -ppass123.