Access denied for user ' admin ' @ ' localhost ' to database problem resolution

Source: Internet
Author: User
Tags mysql in

Handcuffed a case to research, database and Web applications are all deployed, and there is a problem starting Tomcat:

Reported exception: Sqlexception:access denied for user ' admin ' @ ' localhost ' to database

A look at the problem is to know that the database, and guess and user-related, the case of the data and looked, found that the problem of database users, the original installed MySQL in order to facilitate the development, all use is the default root username and password, but this example said is " Please use username Admin and password 111 when installing MySQL

Faint ... Would it be impossible for me to reinstall the database? (Everyone, don't laugh, huh? As a just learn to walk the little rookie, I know very little about the database, only a few simple commands. But with the feeling, I think there must be other ways, the simplest is to use the case of the user name and password to change it, hehe

Do as you are told. who know to find for a long time also can not find, it is Proxool database connection pool, I was the first contact, found that this thing package is too good, unexpectedly cannot find the user name and password used to write the connection code, obviously have seen the emergence of

private static String Proxool = "Org.logicalcobwebs.proxool.ProxoolDriver";

private static String poolname = "Proxool.mingri";

Crash, below do not know where to find, turned over n multiple source code, farfetched. Finally also to the XML file carefully looked at, and did not, I am really depressed, he wrote the code into the database file, it is impossible.

Finally have to give up, to change the other way, the database in the username and password to change the forget, depressed ah. However, a search for information found that the original database can be built under the new user Ah, Khan. Online search is also turned over the book, tried n times have failed, it is estimated that the version is not right, how others write the order I modified after the AH.

Finally do not know how to turn to, MySQL official online, are all English documents, but fortunately can read points, copy of the command to modify a use, oh, it is effective AH

MySQL official website

The new user admin password is 111, and the permissions are Mingri to the database Select,insert,update,delete,create,drop//
GRANT Select,insert,update,delete,create,drop
On mingri.*
To Admin@localhost
Identified by ' 111 ';

Grant all privileges in *.* to ' Administrator ' @ ' localhost ' identified by ' admin ' with GRANT OPTION;

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.