MySQL logon ERROR-ERROR 1045 (28000)

Source: Internet
Author: User

Mysql-uroot-p

Enter the password.

An error occurred!

ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: YSE)


Leave the password Blank

Or error!

ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO)


Change the password!

#/Etc/init. d/mysql stop

# Mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking &

Mysql <----- Logon

Mysql> UPDATE user SET Password = PASSWORD ('newpassword') where USER = 'root'; <---- change the Password

Mysql> flush privileges;





If you forget the password of the root user logging on to mysql

#/Etc/init. d/mysqld stop

Start the database manually

# Mysqld_safe -- skip-grant-tables -- skip-networking &

# Mysql // Login

In this case, you cannot use grant to change the password. You can only use update to change the password)

> Update mysql. user set password = password ('000000') where user = 'root'; // reset the password.

#/Etc/init. d/mysqld restart // restart the database

Skip-grant-tables // skip the authorization table

Skip-networking // skip the network



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.