MYSQL root passwort vergessen

From Bitbull Wiki
Jump to navigation Jump to search
  • Kill the mysqld that may be running (not with -9):
kill `cat /var/lib/mysql/`
  • Restart MySQL in safe mode:
/usr/bin/safe_mysqld --skip-grant-tables &
  • Connect to 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:
  • Stop mysql from command line with:
/etc/init.d/mysql stop
  • Restart mysql from command line with:
/etc/init.d/mysql start