[英]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. 我有以下问题:我将现有项目导入eclipse。 This project references the library mysql-connector-java-5.1.13-bin.jar
. 该项目引用了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. 所以我试图找出是否通过使用终端安装了mySQL:输入-a mysql命令。 Result: type: mysql: not found Now I downloaded and installed mysql. 结果:类型:mysql:找不到现在我下载并安装了mysql。 It is listed in /usr/local/ now. 现在在/ usr / local /中列出了它。 But the command: type -a mysql still shows the same result and the java application produces the same errors. 但是命令:type -a mysql仍然显示相同的结果,并且Java应用程序产生相同的错误。 What do I have to do? 我需要做什么?
You need to check that mysql process is running... 您需要检查mysql进程是否正在运行...
$ ps ax | grep mysql
... and that mysql driver jar is really in your project class path (library). ...并且该mysql驱动程序jar确实在您的项目类路径(库)中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.