Thursday, November 22, 2007

Reset MYSQL root password

Reset the mysql "root" password:
1) Log in as UNIX root
2) Stop the MySQL Deamon (may vary depending on OS)
/etc/rc.d/init.d/mysqld stop
3) Start mysql in safe mode
/usr/local/mysql/bin/mysqld_safe --skip-grant-tables
4) Log into the mysql schema as root in safe mode
/usr/local/mysql/bin/mysql --user=root mysql
5) Run the update to change the password
WHERE Host='localhost' AND User='root';
flush privileges;
6) Restart the MySQL server deamon
/etc/rc.d/init.d/mysqld start

Method set a root password
mysqladmin -u root password 'new-password'

No comments: