Code: mysqladmin -u root password [my-password-here]
gives the output:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
The 'Access denied for user 'root'@'localhost' (using password: NO)' means that a password for root has already been set - it differs from what you found in that the server is indicating that root access to the localhost server is denied because you are not using a password (in other words, root access requires a password that has already been set). Is it possible that it was successfully set in one of your previous attempts? If so, do you remember all of the passwords you have tried over the past couple days?
You can keep attempting to reset the mysql root password with:mysqladmin -u root -p password 'your_new_password'
This will prompt you each time to enter the root password in order to change the root password. I would try this command several times with any/all passwords you have tried setting in the past couple days starting with simply an [Enter] (i.e. nothing). Some other passwords you should try are:
'[my password went here]'
'my password went here'
and any others that may have slipped in there on accident.
I guess worst case scenario would be to stop the mysql server (/etc/rc.d/init.d/mysql stop
), remove /var/lib/mysql/mysql/ (rm -drf /var/lib/mysql/mysql/
), reinstall the default database (mysql_install_db
), and make sure the ownership is set correctly (chown -R mysql.mysql /var/lib/mysql/
) to get back to a default/empty database. Then start the server (mysqld_safe &
), and attempt setting the root password again (mysqladmin -u root password 'password'