无法从Netbeans连接到XAMPP MySQL

时间:2013-07-29 16:56:57

标签: mysql netbeans xampp

我是Windows 7用户,我遇到了MySQL和XAMPP的问题。

我使用XAMPP附带的MySQL。我使用XAMPP的安全页面更改了MySQL的root密码。然后我尝试通过Netbeans连接到MySQL服务器。

为了尝试连接,我点击服务窗格的数据库下拉列表中的MySQL服务器选项,我给了它一些设置:

server host name:localhost
username:root
port:3306
password:(my sql password)
path to admin module:(http:'//')localhost/phpmyadmin
sql start path:D:\D-drive\xampp-portable\mysql\bin\mysqld.exe(also tried mysql_start.bat)
sql stop path:</b>D:\D-drive\xampp-portable\mysql\bin\mysqladmin.exe(also tried sql_stop.bat)

然后我右键单击localhost [root]上的MySQL服务器并选择Connect,这是我收到错误的时候:

Unable to connect to the MySQL server:
org.netbeans.api.db.explorer.DatabaseException: org.netbeans.api.db.explorer.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server..
The server may not be running or your MySQL connection properties may not be set correctly.  Do you want to edit your MySQL connection properties?

将localhost更改为127.0.0.1也不起作用。我也有jdbc驱动程序。

1 个答案:

答案 0 :(得分:2)

对我有用的修复方法如下:

请注意netbeans是防火墙中的允许程序以及防病毒软件

检查:

如果netbeans启动页面显示“无法连接到互联网”,那么您必须更改防火墙和/或防病毒设置以允许它