MYSQL root passwort vergessen
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