Skip to content

Instantly share code, notes, and snippets.

@zainengineer
Last active September 6, 2019 12:24
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 zainengineer/8ae85d3854218127202228b6bfd83c83 to your computer and use it in GitHub Desktop.
Save zainengineer/8ae85d3854218127202228b6bfd83c83 to your computer and use it in GitHub Desktop.
mysql mariadb root password reset
sudo mysql_secure_installation
#its sometimes enough
some time usual approach of passwords reset does not work
https://superuser.com/a/949768/366778
SELECT user, plugin FROM user;
UPDATE user SET plugin="";
Newer mariadb even that does not work
MariaDB [mysql]> UPDATE user SET plugin="";
ERROR 1348 (HY000): Column 'plugin' is not updatable
sudo mysql -uroot --protocol=socket
set password = password("");
normally you can do like usual
https://tecadmin.net/steps-to-reset-mariadb-root-password-in-linux/
sudo service mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
UPDATE user SET authentication_string = password("root") where User='root';
FLUSH PRIVILEGES;
#not sure of that
fg 1
sudo service mysql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment