Copy the Mysql-connector-java-5.1.18-bin.jar package to the Web-inf\lib directory of the project that needs to connect to the MySQL database.
Right-click the project name, build path, Configure build path, Java build path, Libraries
Click the Add External JARs button, pop up the JAR Selection dialog box, specify the location of the Mysql-connector-java-5.1.18-bin.jar package in the dialog box, click OK,
Return to the previous dialog box and click OK again to write the path of the JAR package to the classpath. At this point, a successful installation of the MySQL-deployed driver was installed in the Eclipse project.
Note: If you copy only the jar package to the project's Web-inf\lib directory, Eclipse does not automatically add the jar package to the classpath.
You must use the above steps to add a jar package to the classpath, in which case the jar package can be used by the project.
Eclipse installs the MySQL driver in the project