问题描述
我有以下代码
$ Host =" localhost";
$ User =" Fred";
$ Database =" house";
$ Password =" mypw"
echo" before mysqli< br /> Host:" ; 。 $ Host。 "< br />" 。 $用户。 "< br />" 。
$数据库;
@ $ db = new mysqli($ Host,$ User,$ Password);
echoConnection is 。 mysqli_connect_errno();
执行第一个echo但第二个不执行。我使用命令行运行了相同的
参数:
mysql -h localhost -u Fred -p
然后
使用房子
我连接到房子数据库。
我在IE 7和Firefox中都尝试了相同的结果。
我是这些东西的新手,所以所有的帮助将不胜感激。
谢谢..
I have the following code
$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"
echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
$Database;
@ $db = new mysqli($Host, $User, $Password);
echo "Connection is " . mysqli_connect_errno();
The first echo is executed but the second is not. I have ran the very same
parameters from the command line using:
mysql -h localhost -u Fred -p
Then
use house
and I connect to the house database.
I tried this in both IE 7 and Firefox with the same results.
I''m new to this stuff so all help will be appreciated.
Thanks..
这篇关于MySQL连接失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!