cakephp:警告 2 mysql_connect:php_network_getaddress

发布于 2024-12-26 10:36:24 字数 909 浏览 0 评论 0原文

当我尝试在本地主机上查看我的网站时,收到以下丑陋的警告。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如梦 2025-01-02 10:36:24
'host' => 'localhsot',
                 ^^

拼写检查显示嘘!

'host' => 'localhsot',
                 ^^

Spellcheck says boo!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文