MySQL Error: Access denied for user ' root ' @ ' localhost ' a workaround

Source: Internet
Author: User


Centos6.5 x64,mysql 5.6.20 X64 are 64-bit


By the way record, convenient Yimeimei.


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


Verify that the user name and password are correct.


SELECT * from Mysql.user, after which no localhost user was found

You can copy a row of 127.0.0.1 records, and then change the password again

mysql> UPDATE user SET Password=password (' 123456 ') where user= ' root ';
mysql> FLUSH privileges;


2, after the change, will appear the following exception

Java.sql.SQLException:Your Password has expired. To log the must change it using a client that supports expired passwords.


Select host,user,password_expired from Mysql.user;


Change password_expired to N

This article is from "Ghost Conan's Technical Blog" blog, please be sure to keep this source http://enetq.blog.51cto.com/479739/1587155

MySQL Error: Access denied for user ' root ' @ ' localhost ' a workaround

Related Article

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.