我正在尝试在我的计算机上安装 WAMP。我打开 phpinfo 很好,但是当我尝试运行 testmysql.php 时,我得到一个非常空白的页面。mysql_connect 之前的任何 echo 语句都可以正常工作,但之后的任何 echo 语句都不会出现。
测试mysql.php:
<?php
echo 'before';
$link = mysql_connect('localhost','root','');
echo 'after';
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
echo 'Connection OK';
mysql_close($link);
?>
日志很好 mysql.log 有
130503 14:39:26 [Note] Plugin 'FEDERATED' is disabled.
130503 14:39:26 InnoDB: The InnoDB memory heap is disabled
130503 14:39:26 InnoDB: Mutexes and rw_locks use Windows interlocked functions
130503 14:39:26 InnoDB: Compressed tables use zlib 1.2.3
130503 14:39:26 InnoDB: Initializing buffer pool, size = 128.0M
130503 14:39:26 InnoDB: Completed initialization of buffer pool
130503 14:39:26 InnoDB: highest supported file format is Barracuda.
130503 14:39:26 InnoDB: Waiting for the background threads to start
130503 14:39:27 InnoDB: 1.1.8 started; log sequence number 1595675
130503 14:39:27 [Note] Server hostname (bind-address): '(null)'; port: 3306
130503 14:39:27 [Note] - '(null)' resolves to '::';
130503 14:39:27 [Note] - '(null)' resolves to '0.0.0.0';
130503 14:39:27 [Note] Server socket created on IP: '0.0.0.0'.
130503 14:39:27 [Note] Event Scheduler: Loaded 0 events
130503 14:39:27 [Note] wampmysqld: ready for connections.
Version: '5.5.24-log' socket: '' port: 3306 MySQL Community Server (GPL)
所以我认为问题在于在实际 IP 地址上设置 mysql。我该怎么做呢?