我一直在玩这个代码,以便能够从外部网络连接:
如果只有我使用相同的网络,下面的代码就可以完美运行:
<?php
define ('DB_USER', 'test_user');
define ('DB_PASSWORD', 'test_password');
define ('DB_HOST', '192.168.x.xxx:3306');
define ('DB_NAME', 'testing');
$dbc=mysql_connect(DB_HOST, DB_USER, DB_PASSWORD)
OR die ('Could not connect to MySQL: '.mysql_error()); @mysql_select_db (DB_NAME)
OR die ('Could not select the database" '.mysql_error());;
?>
现在我在路由器设置中找到了 IP 地址 79.xxx.xxx.xx,但是当我尝试替换 192.168.x.xxx ip 时,它显示以下错误:
Could not connect to MySQL: No connection could be made because the target machine actively refused it.
请注意,我已经编辑了 phpmyadmin conf 文件并替换了以下内容:
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
我应该怎么做才能让它工作?请帮忙谢谢