Skip to content

Instantly share code, notes, and snippets.

@arjus
Created August 8, 2018 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arjus/fbfe71233b943d1ee67432e4b1b33009 to your computer and use it in GitHub Desktop.
Save arjus/fbfe71233b943d1ee67432e4b1b33009 to your computer and use it in GitHub Desktop.
Solve mariadb root password access denied
# stop maria db
sudo systemctl stop mysql
sudo systemctl stop mariadb
# start mysql without checks
sudo mysqld_safe --skip-grant-tables &
sudo mysql -u root
#update user root pass
use mysql
SELECT user, plugin FROM user;
UPDATE user SET plugin="";
UPDATE user SET password=PASSWORD("my_password") WHERE user="root";
FLUSH PRIVILEGES;
# restart mariadb
sudo systemctl stop mariadb
/etc/init.d/mysql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment