Java.sql.SQLException:Access denied for user ' root '

Source: Internet
Author: User

The program encountered an error while connecting to the remote MySQL server java.sql.SQLException:Access denied for user ' root ' @ ' 192.168.27.129 ' (using Password:yes)

Native IP is ' 192.168.27.129 '

Go to the MySQL command line:

Mysql>use MySQL;

Mysql>select host,user from user;

See the information below, there is no limit to not allow the computer to connect to MySQL.

+-----------------------+------+
| Host | user |
+-----------------------+------+
| %                     | Root |
| 127.0.0.1 | Root |
| :: 1 | Root |
| localhost | Root |
| Localhost.localdomain | Root |
+-----------------------+------+

is the default not to let root remote login??

Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' Xuxu ' with GRANT OPTION

Permission to access data to any host

3, Mysql>flush privileges

Program again with root and password, log in, the result is successful!

Java.sql.SQLException:Access denied for user ' root '

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.