Java.sql.SQLException:Access denied for user ' root ' @ ' localhost ' (using Password:no)

Source: Internet
Author: User

After updating the project, did some changes found unexpectedly error, just also good.

Java.sql.SQLException:Access denied for user ' root ' @ ' localhost ' (using Password:no)

After that, there are various reasons for finding. The information about no in Chinese is still relatively small. I saw some information on a Japanese website (don't ask me why not goole, net limit).

Summarize it.

1, first go to DOS command to verify that you can log in to MySQL without entering the password

Step: Locate the MySQL installation directory and continue to the bin. After the DOS enters the bin level directory, then executes the mysql-hlocalhost-uroot-p. (the default MySQL service is turned on here)

If you do not need a password to enter, then you go to add a password on the line

2, if you find the above also need a password, and the password is also right, then you can look at your configuration file, in the configuration of the database must be a problem. Like you defined Username=root in Jdbc.properties.

Use {Usrname} when using, take a closer look.

3, also said that the authority is not enough, but Root seems to be the highest authority, this is less permission, we can still believe who ah, but if you are new users have to go to see here.

Java.sql.SQLException:Access denied for user ' root ' @ ' localhost ' (using Password:no)

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.