我使用 NetBeans 运行 PHP 代码。该代码用于更新我们公司服务器上的数据库表。所以我使用了代码:
$link = mysql_connect('192.168.X.X:X','X','X');
mysql_select_db('X',$link);
if (!$link) {die('Could not connect: ' . mysql_error());}
echo 'Connected successfully';
mysql_close($link);
但是当我单击运行时,会返回此错误消息:
( ! ) Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '192.168.0.140' (10060) in C:\wamp\www\database\index.php on line 9
( ! ) Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\database\index.php on line 10
Call Stack