MYSQL root passwort vergessen

From Bitbull Wiki
Revision as of 15:40, 15 September 2017 by Chris (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • Kill the mysqld that may be running (not with -9):
kill `cat /var/lib/mysql/hostname.pid`
  • Restart MySQL in safe mode:
/usr/bin/safe_mysqld --skip-grant-tables &
  • Connect to MySQL:
/usr/bin/mysql
  • Use the mysql database:
use mysql;
  • Run the update command putting your new password where the ....'s are. Yes this is all one command:
update user set password = password('.......') where user = 'root' and host='localhost';
  • Flush the privileges so everything will take:
flush privileges;
  • Then quit mysql:
quit
  • Stop mysql from command line with:
/etc/init.d/mysql stop
  • Restart mysql from command line with:
/etc/init.d/mysql start