Skip to content

Instantly share code, notes, and snippets.

@iambudi
Last active May 13, 2022 12:27
Show Gist options
  • Select an option

  • Save iambudi/1c22b69f49703338cd8b785a45c460f2 to your computer and use it in GitHub Desktop.

Select an option

Save iambudi/1c22b69f49703338cd8b785a45c460f2 to your computer and use it in GitHub Desktop.

Revisions

  1. iambudi renamed this gist May 13, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mysql8-m1-reset-password → mysql8-m1-reset-password.md
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,4 @@ ALTER USER 'root'@'localhost' IDENTIFIED BY 'ReplaceNewPassHere';
    3. Run mysql service `mysqld --init-file=/Users/iambudi/reset_pass.txt`
    4. Connect to mysql using the new password

    When things goes okay, delete the reset_pass.txt, stop and start mysql again.
    When things goes okay, delete the `reset_pass.txt`, stop and start mysql again.
  2. iambudi created this gist May 13, 2022.
    10 changes: 10 additions & 0 deletions mysql8-m1-reset-password
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    1. Make sure mysql service stopped
    `mysql.server stop` or `brew services stop mysql`
    2. Create a text file somewhere ex. `/Users/iambudi/reset_pass.txt` and write this one liner sql to the file:
    ```sql
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'ReplaceNewPassHere';
    ```
    3. Run mysql service `mysqld --init-file=/Users/iambudi/reset_pass.txt`
    4. Connect to mysql using the new password

    When things goes okay, delete the reset_pass.txt, stop and start mysql again.