Type the following commands. First, stop current MySQL database server:
/etc/init.d/mysql stopOR
/etc/init.d/mysqld stopOR
/usr/local/etc/rc.d/mysql-server stopNow, start mysql server without password so that you can restart the password:
mysqld_safe --skip-grant-tables &Login without a password, enter:
mysql -u rootFinally, setup a new MySQL root user password, enter::
USE mysql;Replace NEW-ROOT-PASSWORD with actual password you want to use. Restart running mysql server:
UPDATE user SET password=PASSWORD("NEW-ROOT-PASSWORD") WHERE User='root';
FLUSH privileges;
quit
/etc/init.d/mysql restartTest it:
mysql -u root -p
No comments:
Post a Comment