• always monitor log file
/var/log/mysql/error.log
  • always login as a root with sudo
sudo mysql -uroot -p


1.stop server 2.create file. contents are:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
  • this can be read by mysql

3.start with init file
sudo mysqld --init-file=/home/me/mysql-init &

4.stop server
sudo kill `cat /var/run/mysqld/mysqld.pid`

5.reset in mysql client
$ mysql

mysql> FLUSH PRIVILEGES;

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2019-04-17 14:24:40
Processing time 0.0056 sec