MyEclipse Connection Mysql Database error Resolution _MYSQL

Source: Internet
Author: User
Tags error code

We are now the general site are used to build the MySQL database site, but the internet to see a lot of users Spit database connection is not the problem, now I will combine relevant information to put forward some of my personal insights, I hope to solve the problem for everyone to help.

General MySQL connection is not possible, there are two major reasons: 1, myeclipse configuration error 2, MySQL improperly configured.

First, our general connection steps are as follows:

1, in MyEclipse to connect the MySQL database: Click Window-->show view-->other-->myeclipse database-->db Browser

Figure I: Finding the database connection option

2, selected DB Browser, right click, and select New Data Connection menu, a new MySQL connection, in the new pop-up window fill in the appropriate information, as shown in the following figure:

Figure II: Fill in the appropriate information

3, and then click Finish, complete this operation, but got the following image shown in the error message, tried several times can not connect, in order to verify the user name and password is correct, we in the MySQL terminal to try to enter the user and password, but can connect, this is strange?

Figure three: Hint that the database cannot be connected

Second, the solution:

The final use of the "select * from Mysql.user" terminal; command to query the user table, the result is returned only root a user, and then the myeclipse in the MySQL connection in the user name to root can be connected successfully.

Figure Four: Modify user to Root

Figure five: Prompt connection success

Third, why is this happening?

Although the problem was solved, but we still have to adhere to the spirit of "know it and then know why" to continue to explore, so make a bold and correct decision, reinstall MySQL, when the last step of installation finally understand, we generally selected is "Modify security Settings option, the default user is root, so only select the root user when the terminal queries the user table.

Figure VI: Root is the default user at installation time

If you need MySQL software, download channel to provide the MySQL series software download: s.jb51.net

myeclipse Connection MySQL Database error problem resolution

Today do a BBS website, do the process of connecting MySQL occurred a bit of problem. The error code is as follows

Java.lang.ClassNotFoundException:com.mysql.jdbc.Driver
At Org.apache.catalina.loader.WebappClassLoader.loadClass (webappclassloader.java:1352)
At Org.apache.catalina.loader.WebappClassLoader.loadClass (webappclassloader.java:1198)
At Java.lang.ClassLoader.loadClassInternal (classloader.java:319)
At JAVA.LANG.CLASS.FORNAME0 (Native method)
At Java.lang.Class.forName (class.java:164)

Because I saw the java.lang.ClassNotFoundException:com.mysql.jdbc.Driver, always thought it was my connection jar package out of the problem, the Internet search for a long time, similar problems are jar package problem, But I was sure my jar bag was right, and then I started looking for code, and I found that the code for one of my previous cases was exactly the same, that the previous case was working (it was previously running).

Then I thought it was the time of the reload where did not match, and then I turned over the N more configuration myeclipse data, found that there is no problem. At this time I am very discouraged ah, but I did not give up, then find, and then I ran a previous case, found that the previous case can not be normal operation, I suspect is not connected to the jar package, nor is it a code problem.

I found that two lines before at JAVA.LANG.CLASS.FORNAME0 (Native) are at Org.apache.catalina.loader.WebappClassLoader.loadClass ( webappclassloader.java:1352)
At Org.apache.catalina.loader.WebappClassLoader.loadClass (webappclassloader.java:1198)

On the Internet to find the two lines of information, found that the 8080-port Tomcat problem, restart Tomcat, found OK!!!

Oh, it was so exciting ah! But this problem should be recorded, to avoid the same problems in the future!

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.