- Stop mysql service:
sudo service mysql stop
- Start mysqld with following arguments: --skip-grant-tables and --skip-networking:
sudo mysqld --skip-grant-tables --skip-networking &
- Run following command to upgrade the database:
sudo mysql_upgrade
- Connect to mysql server:
mysql
- Run following SQL clauses to change root password:
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES;
- Stop the msyql process:
sudo killall -9 mysqld
- Start mysql service:
sudo service mysql stop
No comments:
Post a Comment