I get the error message "Cannot connect to database server". ("Database connection terminated") Ĭatch (Exception e) String url = "jdbc:mysql://localhost/testdb" Ĭlass.forName ("").newInstance () Ĭonn = DriverManager.getConnection (url, userName, password) You must have the MySQL Yum repository on your systems repository list (see Adding the MySQL Yum Repository for details). You can choose your platform specified in the Select Platform drop. 4.2.1 Installing Connector/ODBC Using the MySQL Yum Repository The MySQL Yum repository for Oracle Linux, Red Hat Enterprise Linux, CentOS, and Fedora provides Connector/ODBC RPM packages using the MySQL Yum repository. Second, select your appropriate platform. First, go to the Download Connector/J page on website. I am trying to connect to a test database on the same server using this code. Third, once the installation completes, you can launch it by double click on the NetBeans IDE icon. The latest MySQL 8. Do not use Connector/J v8 or newer due to the possible error: The server time zone value ‘AEDT’ is unrecognized or represents more than one time zone. The connector is installed here usr/bin/mysql-connector-java-5.1.12. MySQL is the most popular, free and open-source relational database management platform, which is used to host multiple databases on any single server by allowing multi-user access to each database. Download the appropriate version of MySQL Connector/J (JDBC Driver) for your MySQL and extract it on your server. I am using CentOS 5.4, Java, and MySQL 5.0.77, and mysql-connector-java-5.1.12.
0 Comments
Leave a Reply. |