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