Skip to content

Instantly share code, notes, and snippets.

@tmilos
Last active May 17, 2018 11:11
Show Gist options
  • Select an option

  • Save tmilos/f98d44662efcad9231cdc32abc8c1b74 to your computer and use it in GitHub Desktop.

Select an option

Save tmilos/f98d44662efcad9231cdc32abc8c1b74 to your computer and use it in GitHub Desktop.

Revisions

  1. tmilos renamed this gist May 17, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. tmilos revised this gist May 17, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    ```bash
    # Stop MySQL
    sudo service mysql stop
    # Make MySQL service directory.
    @@ -15,4 +16,5 @@ EXIT;
    # Turn off MySQL.
    sudo mysqladmin -S /var/run/mysqld/mysqld.sock shutdown
    # Start the MySQL service normally.
    sudo service mysql start
    sudo service mysql start
    ```
  3. tmilos created this gist May 17, 2018.
    18 changes: 18 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    # Stop MySQL
    sudo service mysql stop
    # Make MySQL service directory.
    sudo mkdir /var/run/mysqld
    # Give MySQL user permission to write to the service directory.
    sudo chown mysql: /var/run/mysqld
    # Start MySQL manually, without permission checks or networking.
    sudo mysqld_safe --skip-grant-tables --skip-networking &
    # Log in without a password.
    mysql -uroot mysql

    UPDATE mysql.user SET authentication_string=PASSWORD('YOURNEWPASSWORD'), plugin='mysql_native_password' WHERE User='root' AND Host='%';
    EXIT;

    # Turn off MySQL.
    sudo mysqladmin -S /var/run/mysqld/mysqld.sock shutdown
    # Start the MySQL service normally.
    sudo service mysql start