Process
suggest change- Stop the MySQL (mysqld) server/daemon process.
- Start the MySQL server process the –skip-grant-tables option so that it will not prompt for a password:
mysqld_safe --skip-grant-tables &
- Connect to the MySQL server as the root user:
mysql -u root
- Change password:
- (5.7.6 and newer):
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new-password';
- (5.7.5 and older, or MariaDB):
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new-password); flush privileges; quit;
- Restart the MySQL server.
Note: this will work only if you are physically on the same server.
Online Doc: http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents