简体   繁体   中英

MySQL not found on Mac, problems with eclipse project using mysql-connector-java-5.1.13-bin.jar

I have the following problem: I imported an existing project into eclipse. This project references the library mysql-connector-java-5.1.13-bin.jar . When I try to run the project I get the following errors:

Trying to add database driver (JDBC): RmiJdbc.RJDriver - Warning, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Warning, not in CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Warning, not in CLASSPATH?
Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Warning, not in CLASSPATH?
Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

So I tried to find out if mySQL is installed by using the terminal: type -a mysql command. Result: type: mysql: not found Now I downloaded and installed mysql. It is listed in /usr/local/ now. But the command: type -a mysql still shows the same result and the java application produces the same errors. What do I have to do?

You need to check that mysql process is running...

$ ps ax | grep mysql

... and that mysql driver jar is really in your project class path (library).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM