msgbartop
MAC OS X, Linux, Windows and other IT Tips and Tricks
msgbarbottom

27 Aug 15 Resetting MySQL passwords in Linux Debian/Ubuntu

In Linux Debian/Ubuntu an extra user debian-sys-maint which also has all the access rights is used for maintenance. It can also be used to reset users passwords especially the root password when lost. Here are some tips regarding resetting them.

Resetting the ‘root’ password
mysqladmin -u root -p password "MyNewPass"
OR
mysql -u debian-sys-maint -p
update mysql.user set Password=password('MyNewPass') where User='root';
flush privileges;
quit;

Resetting/creating the user and giving it all the access rights.
eg. debian-sys-maint
mysql -u root -p
create user 'debian-sys-maint'@'localhost' identified by 'UserPassword';
grant all privileges on *.* to 'debian-sys-maint'@'localhost'
flush privileges;
quit;

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: