Skip to content

Instantly share code, notes, and snippets.

@zubaer-ahammed
Last active September 27, 2025 02:50
Show Gist options
  • Save zubaer-ahammed/c81c9a0e37adc1cb9a6cdc61c4190f52 to your computer and use it in GitHub Desktop.
Save zubaer-ahammed/c81c9a0e37adc1cb9a6cdc61c4190f52 to your computer and use it in GitHub Desktop.

Revisions

  1. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -26,8 +26,8 @@ Process to Reset MySQL Root Pass in Mac:
    ```

    5. Now flush privileges:
    ```sql
    FLUSH PRIVILEGES;
    ```
    ```sql
    FLUSH PRIVILEGES;
    ```
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  2. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 10 additions and 4 deletions.
    14 changes: 10 additions & 4 deletions Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -13,15 +13,21 @@ OR,
    Process to Reset MySQL Root Pass in Mac:
    ----------------------
    1. Make sure you have Stopped MySQL first (above).
    2. Run the server in safe mode with privilege bypass: ```sudo mysqld_safe --skip-grant-tables```
    3. In a new window connect to the database, set a new password and flush the permissions & quit: ```mysql -u root```
    4. **For MySQL older than MySQL 5.7 use**: ```UPDATE mysql.user SET Password=PASSWORD('rootpass') WHERE User='root';```
    2. Run the server in safe mode with privilege bypass: `sudo mysqld_safe --skip-grant-tables`
    3. In a new window connect to the database, set a new password and flush the permissions & quit: `mysql -u root`
    4. **For MySQL older than MySQL 5.7 use**:
    ```sql
    UPDATE mysql.user SET Password=PASSWORD('rootpass') WHERE User='root';
    ```

    **For MySQL 5.7+ use:**
    ```sql
    UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';
    ```

    5. `FLUSH PRIVILEGES;`{:.language-ruby}
    5. Now flush privileges:
    ```sql
    FLUSH PRIVILEGES;
    ```
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  3. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,10 @@ Process to Reset MySQL Root Pass in Mac:
    3. In a new window connect to the database, set a new password and flush the permissions & quit: ```mysql -u root```
    4. **For MySQL older than MySQL 5.7 use**: ```UPDATE mysql.user SET Password=PASSWORD('rootpass') WHERE User='root';```

    **For MySQL 5.7+ use:** ```UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';```
    **For MySQL 5.7+ use:**
    ```sql
    UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';
    ```

    5. `FLUSH PRIVILEGES;`{:.language-ruby}
    6. Restart MySQL server.
  4. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,6 @@ Process to Reset MySQL Root Pass in Mac:

    **For MySQL 5.7+ use:** ```UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';```

    5. `FLUSH PRIVILEGES;`{:.language-sql}
    5. `FLUSH PRIVILEGES;`{:.language-ruby}
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  5. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,6 @@ Process to Reset MySQL Root Pass in Mac:

    **For MySQL 5.7+ use:** ```UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';```

    5. `FLUSH PRIVILEGES;`{.language-sql}
    5. `FLUSH PRIVILEGES;`{:.language-sql}
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  6. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,6 @@ Process to Reset MySQL Root Pass in Mac:

    **For MySQL 5.7+ use:** ```UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';```

    5. `FLUSH PRIVILEGES;`{.sql}
    5. `FLUSH PRIVILEGES;`{.language-sql}
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  7. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 1 addition and 5 deletions.
    6 changes: 1 addition & 5 deletions Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -19,10 +19,6 @@ Process to Reset MySQL Root Pass in Mac:

    **For MySQL 5.7+ use:** ```UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';```

    5.
    ```php
    FLUSH PRIVILEGES;
    ```

    5. `FLUSH PRIVILEGES;`{.sql}
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  8. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ Process to Reset MySQL Root Pass in Mac:
    **For MySQL 5.7+ use:** ```UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';```

    5.
    ```sql
    ```php
    FLUSH PRIVILEGES;
    ```

  9. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -19,8 +19,10 @@ Process to Reset MySQL Root Pass in Mac:

    **For MySQL 5.7+ use:** ```UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';```

    5. ```sql
    FLUSH PRIVILEGES;
    ```
    5.
    ```sql
    FLUSH PRIVILEGES;
    ```

    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  10. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,8 @@ Process to Reset MySQL Root Pass in Mac:

    **For MySQL 5.7+ use:** ```UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';```

    5. ```FLUSH PRIVILEGES;```
    5. ```sql
    FLUSH PRIVILEGES;
    ```
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  11. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    First Stop MySQL:
    ------
    1. Go to: 'System Preferences' >> 'MySQL'
    1. Go to: 'System Preferences' >> 'MySQL' and stop MySQL

    OR,

  12. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ## Reset mysql root password in Mac OS:

    MySQL:
    First Stop MySQL:
    ------
    1. Go to: 'System Preferences' >> 'MySQL'

    @@ -12,7 +12,7 @@ OR,

    Process to Reset MySQL Root Pass in Mac:
    ----------------------
    1. Stop MySQL
    1. Make sure you have Stopped MySQL first (above).
    2. Run the server in safe mode with privilege bypass: ```sudo mysqld_safe --skip-grant-tables```
    3. In a new window connect to the database, set a new password and flush the permissions & quit: ```mysql -u root```
    4. **For MySQL older than MySQL 5.7 use**: ```UPDATE mysql.user SET Password=PASSWORD('rootpass') WHERE User='root';```
  13. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -13,12 +13,12 @@ OR,
    Process to Reset MySQL Root Pass in Mac:
    ----------------------
    1. Stop MySQL
    2. Run the server in safe mode with privilege bypass: sudo mysqld_safe --skip-grant-tables
    3. In a new window connect to the database, set a new password and flush the permissions & quit: mysql -u root
    4. **For MySQL older than MySQL 5.7 use**: UPDATE mysql.user SET Password=PASSWORD('rootpass') WHERE User='root';
    2. Run the server in safe mode with privilege bypass: ```sudo mysqld_safe --skip-grant-tables```
    3. In a new window connect to the database, set a new password and flush the permissions & quit: ```mysql -u root```
    4. **For MySQL older than MySQL 5.7 use**: ```UPDATE mysql.user SET Password=PASSWORD('rootpass') WHERE User='root';```

    **For MySQL 5.7+ use:** UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';
    **For MySQL 5.7+ use:** ```UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';```

    5. FLUSH PRIVILEGES;
    5. ```FLUSH PRIVILEGES;```
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  14. zubaer-ahammed revised this gist Aug 12, 2017. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -10,16 +10,15 @@ OR,
    2) sudo /usr/local/mysql/support-files/mysql.server stop
    3) sudo /usr/local/mysql/support-files/mysql.server status

    UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';


    Process to Reset MySQL Root Pass in Mac:
    ----------------------
    1. Stop MySQL
    2. Run the server in safe mode with privilege bypass: sudo mysqld_safe --skip-grant-tables
    3. In a new window connect to the database, set a new password and flush the permissions & quit: mysql -u root
    4. For MySQL older than MySQL 5.7 use: UPDATE mysql.user SET Password=PASSWORD('rootpass') WHERE User='root';
    For MySQL 5.7+ use: UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';
    4. **For MySQL older than MySQL 5.7 use**: UPDATE mysql.user SET Password=PASSWORD('rootpass') WHERE User='root';

    **For MySQL 5.7+ use:** UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';

    5. FLUSH PRIVILEGES;
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
  15. zubaer-ahammed created this gist Aug 12, 2017.
    25 changes: 25 additions & 0 deletions Reset MySQL Root Password in Mac OS.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    ## Reset mysql root password in Mac OS:

    MySQL:
    ------
    1. Go to: 'System Preferences' >> 'MySQL'

    OR,

    1) sudo /usr/local/mysql/support-files/mysql.server start
    2) sudo /usr/local/mysql/support-files/mysql.server stop
    3) sudo /usr/local/mysql/support-files/mysql.server status

    UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';


    Process to Reset MySQL Root Pass in Mac:
    ----------------------
    1. Stop MySQL
    2. Run the server in safe mode with privilege bypass: sudo mysqld_safe --skip-grant-tables
    3. In a new window connect to the database, set a new password and flush the permissions & quit: mysql -u root
    4. For MySQL older than MySQL 5.7 use: UPDATE mysql.user SET Password=PASSWORD('rootpass') WHERE User='root';
    For MySQL 5.7+ use: UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';
    5. FLUSH PRIVILEGES;
    6. Restart MySQL server.
    7. **More info:** http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x