# Mysql-uroot-p
Enter Password:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)
Use the Web-based method to modify the root user's password:
# mysqladmin-uroot-p password ' newpassword '
Enter Password:
Mysqladmin:connect to server at ' localhost ' failed
Error: ' Access denied for user ' root ' @ ' localhost ' (using Password:yes) '
And now I've finally found a solution:
switch to root user, After entering the MySQL bin directory,
[Email protected]:/usr/local/mysql/bin# /etc/ Init.d/mysql stop
[email protected]:/usr/local/mysql/bin# ./mysqld_safe--user=mysql--skip-grant-tables--skip-networking &
[Email protected]:/usr/local/mysql/bin# ./mysql-u root MySQL
mysql> UPDATE user SET Password=password (' NewPassword ') where user= ' root ';
mysql> FLUSH privileges;
Mysql> quit;
Finally, restart the database:
[Email protected]:/usr/local/mysql/bin# /etc/init.d/mysql restart
[Email protected]:/usr/local/mysql/bin# mysql-u root-p
Enter Password: < Enter the newly set password newpassword>
Mysql>
MySQL ERROR 1045 (28000): Access denied for user '