【问题标题】:Error displaying the error page: Application Instantiation Error: Could not connect to MySQL error显示错误页面时出错:应用程序实例化错误:无法连接到 MySQL 错误
【发布时间】:2015-03-09 01:20:29
【问题描述】:

我刚刚将我的服务器移到网站上,但即使在我编辑完config.php 之后我仍然有这个错误,我不知道为什么 MySQL 仍然没有连接:(

请帮助我。我在数据库中的所有用户名密码和主机名都是正确的;但是自从我执行上述任务以来,所有用户名和密码都没有显示(可能丢失了)。

<?php
class JConfig {
    public $offline = '0';
    public $offline_message = 'This site is down for maintenance.<br /> Please check back again soon.';
    public $display_offline_message = '1';
    public $offline_image = '';
    public $sitename = 'localhost';
    public $editor = 'jce';
    public $captcha = '0';
    public $list_limit = '20';
    public $access = '1';
    public $debug = '0';
    public $debug_lang = '0';
    public $dbtype = 'mysql';
    public $host = 'localhost';
    public $user = 'xxx';
    public $password = 'xxx';
    public $db = 'xxx';
    public $dbprefix = 'ocer4_';
    public $live_site = '';
    public $secret = '2PvZ36bJU5A7Iceo';
    public $gzip = '0';
    public $error_reporting = 'default';
    public $helpurl = 'http://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:{keyref}';
    public $ftp_host = 'ftp.byethost13.com';
    public $ftp_port = '';
    public $ftp_user = 'b13_15953110';
    public $ftp_pass = '';
    public $ftp_root = '';
    public $ftp_enable = '0';
    public $offset = 'UTC';
    public $mailonline = '1';
    public $mailer = 'mail';
    public $mailfrom = 'tsukishiro_lee@yahoo.com';
    public $fromname = 'localhost';
    public $sendmail = '/usr/sbin/sendmail';
    public $smtpauth = '0';
    public $smtpuser = '';
    public $smtppass = '';
    public $smtphost = 'localhost';
    public $smtpsecure = 'none';
    public $smtpport = '25';
    public $caching = '0';
    public $cache_handler = 'file';
    public $cachetime = '15';
    public $MetaDesc = '';
    public $MetaKeys = '';
    public $MetaTitle = '1';
    public $MetaAuthor = '1';
    public $MetaVersion = '0';
    public $robots = '';
    public $sef = '1';
    public $sef_rewrite = '0';
    public $sef_suffix = '0';
    public $unicodeslugs = '0';
    public $feed_limit = '10';
    public $log_path = '/htdocs/logs';
    public $tmp_path = '/htdocs/tmp';
    public $lifetime = '15';
    public $session_handler = 'database';
    public $memcache_persist = '1';
    public $memcache_compress = '0';
    public $memcache_server_host = 'localhost';
    public $memcache_server_port = '11211';
    public $memcached_persist = '1';
    public $memcached_compress = '0';
    public $memcached_server_host = 'localhost';
    public $memcached_server_port = '11211';
    public $proxy_enable = '0';
    public $proxy_host = '';
    public $proxy_port = '';
    public $proxy_user = '';
    public $proxy_pass = '';
    public $MetaRights = '';
    public $sitename_pagetitles = '0';
    public $force_ssl = '0';
    public $session_memcache_server_host = 'localhost';
    public $session_memcache_server_port = '11211';
    public $session_memcached_server_host = 'localhost';
    public $session_memcached_server_port = '11211';
    public $frontediting = '1';
    public $feed_email = 'author';
    public $cookie_domain = '';
    public $cookie_path = '';
    public $asset_id = '1';
}

【问题讨论】:

  • 这是 Joomla 吗?如果有,你看过docs.joomla.org/Unable_to_connect_to_the_database 吗?
  • 是的,但它仍然无法在这里工作是代码(编辑帖子)我不知道如何,但在我的帐户信息中,sql 主机名不可用:(。我只使用免费托管帐户只是为了我的项目请帮助我@eggyal

标签: mysql joomla


【解决方案1】:

问题似乎是$host = 'localhost'
我检查了您的主机配置,您应该拥有类似sqlxxx.byethost13.com 的 mysql 主机。

所以将$host 变量更新为:

  public $host = "sqlxxx.byethost13.com";

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-06-25
    • 2019-10-14
    • 2014-06-16
    • 1970-01-01
    • 2012-06-28
    • 2018-05-26
    • 2013-11-01
    • 1970-01-01
    相关资源
    最近更新 更多