ERROR1045 (28000): Accessdeniedforuser 'root' @ 'localhost

Source: Internet
Author: User
ERROR1045 (28000): Accessdeniedforuser

ERROR 1045 (28000): Access denied for user

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

This problem is also a problem left over when installing the mysql database in Linux:

After installing mysql, the user useradd mysql does not need a password to log on to the mysql database. The root user needs a logon password.

When joomla is put under hotdocs this time, restore the database:

Mysql <joomla. SQL

The following error is prompted:

It means that the root user cannot access the database without a password. What should I do? Change Password:

1> enter mysql

Mysql-u root-p

Dell_456

2> change password:

Set password for 'root' @ 'localhost' = password ('') Here it is actually Set to an empty password

Flush privileges;

This statement indicates that you need to use flush privileges to refresh a user in mysql after setting the user or changing the password.

Mysql system permission table. Otherwise, access is denied. Another method is to restart the mysql server.

To make the settings take effect.

,

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.