Lost MySQL Admin Password

If you’ve lost the MySQL admin password, you can reset it by following these steps:

  1. Stop the MySQL server:
    sudo systemctl stop mysql
  2. Start the MySQL server with the --skip-grant-tables option to skip the permission check:
    sudo mysqld_safe --skip-grant-tables &
  3. Connect to the MySQL server as the root user without a password:
    mysql -u root
  4. Set a new password for the root user by running the following SQL command:
    FLUSH PRIVILEGES;
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

    Replace “new_password” with your new desired password.

  5. Exit the MySQL client and stop the MySQL server:
    exit
    sudo systemctl stop mysql
  6. Start the MySQL server normally:
    sudo systemctl start mysql

You should now be able to connect to the MySQL server using the new password. Keep in mind that this process can be slightly different depending on your version of MySQL and your operating system.

By ottomax taking on healthy behaviors, you can properly decrease your cholesterol as well as decrease your risk of heart disease.

Leave a Comment