"Java advanced"--myeclipse connect MySQL Start database service

Source: Internet
Author: User

background:

The DRP project requires Oracle databases, but for a variety of reasons, Oracle is temporarily unavailable. But also can't idle ah, take MySQL to try. After the installation of MySQL, using MyEclipse connection database, has been error, error information as follows. Later found that the database service is not started, followed by the specific steps.

Com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Communications Link failurethe last packet sent successfully To the server was 0 milliseconds ago. The driver has no received any packets from the server.

steps:

1, in the MyEclipse, Window->open perspective->myeclipse Database Explorer.

After opening, the interface appears on the left, and right-clicking the--new in the blank area.





Tips: How should these parameters be filled in?

1) Driver template Select MySQL connector/j

2) Driver name can be custom named.

3) Connection URL connection string, which needs to be explained in the example

jdbc:mysql://127.0.0.1:3306/test, "127.0.0.1" can also be written as "localhost", "3306" is the default end of MySQL

Port, "Test" is the name of the database to which you want to connect.

4) user name of the connection database, MySQL defaults to "root".

5) Password Connect to the database password, that is, log in to MySQL password.


Tips: How do I check the port of MySQL?

Enter the MySQL command window and enter show global variables like ' port ';   

Note: There is a semicolon at the end.



Select the path where the driver is located and click Finish.



2. Select the db you built, right-click Open Connection, enter the user name and password.



You can then see that the connection is successful and you can view the database.



Impressions:

Connected to the database problem, troubled me for a long time. In fact, after the real fix, also feel seemingly not so difficult, in fact, they can be done independently. The main is to have careful, patient, coupled with self-confidence. Follow the steps and you'll find that the process is familiar, and we've been exposed to a lot of things that make connections and test data sources, and that's not something new. The last suggestion is more Baidu, see more help.


"Java advanced"--myeclipse connect MySQL Start database service

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.