1

我是 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 驱动程序。

4

1 回答 1

2

对我有用的修复如下:

请查看 netbeans 是您防火墙中允许的程序以及防病毒软件

以检查:

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

于 2013-07-30T15:02:42.507 回答