Quick & Easy: Reset MySQL root Password (Ubuntu 16.04)

  • service mysql stop
  • mysqld_safe --skip-grant-tables &
  • mysql -u root
  • use mysql;
  • flush privileges;
  • SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
  • quit
  • pkill -9 mysqld
  • service mysql restart
  • mysql -u root -p
DigitalOcean Referral Badge
Keep my site online & receive a $100 60-day credit at DigitalOcean for your VPS Hosting
Cheaper Games on Instant-Gaming
Proudly published with Ghost | Header Image by GUWEIZ@DeviantArt Creative Commons Licence