Problems with connecting to MySQL

Source: Internet
Author: User

1. java. Lang. classnotfoundexception: COM. MySQL. JDBC. Driver

Cause: the driver cannot be found.

Solution: copy the mysql-connector-java-5.x.x-bin.jar to the Tomcat lib directory

2. java. SQL. sqlexception: Access denied for user
'Admin' @ 'localhost' (using password: Yes)

Cause: the user name and password are incorrect.

 

Using MySQL workbench 5.2 ce to change the password is a pain point. After the initial password is set, the user name can be changed, but the password cannot be changed.

So cmd waited:

Cd d: \ Program Files \ mysql server 5.5 \ bin

Run MySQL

Actually can go in...

Select User ();

First, the account used is

And

My test database can also be used by it,I added the white password...

 

Forget it. Release the problem first.

How can I modify my root password in cmd:

Related Articles:

Mysql-hlocalhost-uroot-P (enter the MySQL Database Management System DBMS with the specified user name)

Enter the password admin.

Going in ..

In this case, viewing the database is different.

Use MySQL)

Update user SET Password = PASSWORD ('root') where host = 'localhost' and user = 'root'; (Change Password to root)

Flush privileges; (this statement is not added and only valid for the current window)

Modification completed!

 

Desc user; (obtain the table structure)

Select * from user; (obtain all data in the User table)

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.