cakephp:警告 2 mysql_connect:php_network_getaddress
当我尝试在本地主机上查看我的网站时,收到以下丑陋的警告。
mysql_connect() [function.mysql-connect]: php_network_getaddresses: getaddrinfo failed: No such host is known. [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php, line 561]Code | Context$config = array(
"persistent" => false,
"host" => "*****",
"login" => "*****",
"password" => "*****",
"database" => "*****",
"port" => "*****",
"driver" => "mysql",
"prefix" => "*****"
)
以下是database.php
<?php
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhsot',
'login' => 'root',
'password' => 'pass',
'database' => 'merry_flowers_db',
);
}
?>
我没有发现database.php
有什么问题。它与我连接到同一数据库的其他 cakephp 项目完全相同。我的其他项目没有收到此错误。有人可以帮我解决这个问题吗?
I'm getting the following ugly warning when I try to view my website on localhost.
mysql_connect() [function.mysql-connect]: php_network_getaddresses: getaddrinfo failed: No such host is known. [CORE\cake\libs\model\datasources\dbo\dbo_mysql.php, line 561]Code | Context$config = array(
"persistent" => false,
"host" => "*****",
"login" => "*****",
"password" => "*****",
"database" => "*****",
"port" => "*****",
"driver" => "mysql",
"prefix" => "*****"
)
the following is database.php
<?php
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhsot',
'login' => 'root',
'password' => 'pass',
'database' => 'merry_flowers_db',
);
}
?>
I don't see anything wrong with database.php
. It is exactly the same as my other cakephp projects that connect to the same database. I'm not getting this error for my other projects. Can someone help me out with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
拼写检查显示嘘!
Spellcheck says boo!