Skip to content

Instantly share code, notes, and snippets.

@BKeanu1989
Created October 24, 2019 09:24
Show Gist options
  • Save BKeanu1989/7ff8806e32bd8fab5cca1aec0a4ed7ad to your computer and use it in GitHub Desktop.
Save BKeanu1989/7ff8806e32bd8fab5cca1aec0a4ed7ad to your computer and use it in GitHub Desktop.
reset-mysql-root-pw

source: https://devanswers.co/how-to-reset-mysql-root-password-ubuntu/ #mysql 5.7

sudo /etc/init.d/mysql stop sudo mkdir /var/run/mysqld sudo chown mysql /var/run/mysqld

sudo mysqld_safe --skip-grant-tables& sudo mysql --user=root mysql mysql> update user set authentication_string=PASSWORD('your_password_here') where user='root';

update user set plugin="mysql_native_password" where User='root'; mysql> update user set plugin="mysql_native_password" where User='root'; mysql> flush privileges; mysql> exit sudo killall -u mysql sudo /etc/init.d/mysql start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment