Guest User

Untitled

a guest
May 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. ```bash
  2. # Stop MySQL
  3. sudo service mysql stop
  4. # Make MySQL service directory.
  5. sudo mkdir /var/run/mysqld
  6. # Give MySQL user permission to write to the service directory.
  7. sudo chown mysql: /var/run/mysqld
  8. # Start MySQL manually, without permission checks or networking.
  9. sudo mysqld_safe --skip-grant-tables --skip-networking &
  10. # Log in without a password.
  11. mysql -uroot mysql
  12.  
  13. UPDATE mysql.user SET authentication_string=PASSWORD('YOURNEWPASSWORD'), plugin='mysql_native_password' WHERE User='root' AND Host='%';
  14. EXIT;
  15.  
  16. # Turn off MySQL.
  17. sudo mysqladmin -S /var/run/mysqld/mysqld.sock shutdown
  18. # Start the MySQL service normally.
  19. sudo service mysql start
  20. ```
Add Comment
Please, Sign In to add comment