当前位置:网站首页>[notes for personal use] detailed steps for connecting MyEclipse to MySQL database

[notes for personal use] detailed steps for connecting MyEclipse to MySQL database

2022-06-21 06:34:00 Little witch thousand fish

First step open Database

open myeclipse And then click window window Click on Open Perspective Menu MyEclipse Database Explorer Enter the figure below

The second step Create connection

Right click in the blank to create a new ( namely new) Or click the shortcut key in the menu bar ( The downward triangle symbol in Figure 2 ) newly build . eject Database Driver See the following figure for the menu

The third step Choose the connection mode

stay Driver template In the option box choice MySql Connector/j Such as , The figure below

Step four Fill in the configuration information

stay Driver name Fill in the name of the linked database ( This can be filled out as you like , It is suggested that it should be related to the name of the project for easy use )

Connection URL Used to fill in the connection to use mysql The address of the database (jdbc:mysql://[<:3306>]/) Can be changed to (jdbc:mysql://localhost:3306/test), among localhost It means to connect to the local database ,3306 Yes means connection mysql The port number of the database ( Different database port numbers are also different ),

User name Fill in the database user name mysql The default is root

Password Fill in the interview mysql The access password you set for the database . Such as , The figure below

Step five Add driver

Click on Add JARs add to myeclipse Connect mysql Database driver file ( The best file to store the driver is an English directory , Determine during the test mysql The database has been opened , Otherwise the test will not succeed ), What is added here is mysql-connector-java-5.1.7-bin edition ( Can search and download online 、) Such as , The figure below

Step six Test whether the data configuration is correct

Click on Test Driver Test whether the configuration is successful , Enter the password to access the database . Such as , The figure below

Step seven Test success

Test connection mysql Database success , Click on Finish Finish creating connection .

Step 8 Connect to database

Right click the connection you created and click Open another connection Input mysql You can see the database table created by the database password .
Reprinted from this article

原网站

版权声明
本文为[Little witch thousand fish]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206210613069114.html