Thursday 17 June 2010

How to reset mysql root password on slackware 13.1

Step # 1: Stop the MySQL server process.
/etc/rc.d/rc.mysqld stop

Step # 2: Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for password.
mysqld_safe --skip-grant tables &

Step # 3: Connect to mysql server as the root user.
mysql --user=root mysql

Step # 4: Setup new mysql root account password.
UPDATE user SET password=PASSWORD("newpwd") WHERE user="root";
FLUSH PRIVILEGES;
QUIT;

Step # 5: Restart the MySQL server.
/etc/rc.d/rc.mysqld restart

Step # 6: Log on mysql with the new password
mysql --user=root --password=newpwd

No comments: