Back
Start the mysqld configuration: sudo mysqld --skip-grant-tables &
In some circumstances, you need to be creating the /var/run/mysqld first:
sudo mkdir -v /var/run/mysqld && sudo chown mysql /var/run/mysqld
Replace YOURNEWPASSWORD with your new password:
UPDATE mysql.user SET Password = PASSWORD('YOURNEWPASSWORD') WHERE User = 'root'; FLUSH PRIVILEGES; exit;
Note: on some versions, if password column doesn't exist, you may want to try:
UPDATE user SET authentication_string=password('YOURNEWPASSWORD') WHERE user='root';
Interested in SQL ? Check out this SQL Certification by Intellipaat.
31k questions
32.8k answers
501 comments
693 users