Skip to content
Related Articles

Related Articles

Adding MySQL Connector to the Java Project in Apache NetBeans
  • Difficulty Level : Easy
  • Last Updated : 03 Mar, 2021
GeeksforGeeks - Summer Carnival Banner

Adding MySQL connector to the Java Project sometimes creates a fuss for the programmer. In this article, we have provided the steps to install or add the MySQL connector to your project.

Please note that before downloading the MySQL connector, you should be clear about the version of the MySQL you are using i.e. whether it is version 5 or 8. To check which version of MySQL is installed in your computer open the MySQL command line client; write the query show variables like ‘%version%’; this will give you a table containing multiple rows, check the version row of the table and confirm your version installed.

Step 1: After ensuring the version, if you have the version 8 then just search for MySQL connector version 8 and download it from the official website. Else if the version is 5 then go to the Archived page of the MySQL and select the Product version to anyone among all present for version 5. Select the operating system to be platform independent. Download ZIP Archive file which contains the JAR file of the connector.

Step 2: Open the downloaded zipped folder and copy the folder present in it to some other location of your choice.



Step 3: Open the Apache NetBeans and right click on the project in which you have to add the connector. In the option pane, click on Properties.

Step 4: In properties, go to Libraries and click on the plus ‘+’ tab of the Classpath and choose Add JAR/Folder.

Step 5: Browse the folder which we copied to some other location and choose the JAR file present in that folder with name such as mysql-connector-java-8.0.22 and click on Open.

Step 6: Uncheck the box of Build Dependencies and click on Ok.

Step 7: You will note that the MySQL connector is shown in the Libraries package of your project.

Congratulations, MySQL connector has been successfully installed for your project.

Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more,  please refer Complete Interview Preparation Course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :