Categories

有特色的模板

Joomla排忧解难. 如何修复数据库连接错误

Amina Freinger 二零一四年十一月十九日
Rating: 3.8/5. From 4 votes.
Please wait...

本教程将向您展示如何进行修复 database 在Joomla引擎或模板安装过程中可能出现的连接错误.

Joomla排忧解难. 如何修复数据库连接错误

If you see "Database Connection error (2): could not connect to mysql" 错误消息,这通常意味着您的Joomla配置错误.PHP文件有错误 database 名字或错误 database username. 要修复这个错误,您应该检查您的配置.PHP文件并确保您使用的是正确的 MySQL 用户名和密码. 请执行以下步骤:

  1. Connect to your FTP 或开立 File Manager. In the root folder Joomla的安装目录 configuration.php file.

  2. 用任何代码打开这个文件 editor and check your database details. 这些设置将在文件中显示如下:

    	Public $user = 'amina';
    	公共$password = '784512';
    
  3. 请比较一下 database 用户名和密码与您安装Joomla时使用的用户名和密码应该匹配. 如果没有,请在配置中纠正它们.php file. 不要忘记保存更改.

    如果您确定设置是正确的,建议您重新设置 database user password and update 配置.使用新密码创建PHP文件. 这将有助于确保您有正确的 database password set.

  4. 刷新页面并检查您的站点. 现在应该可以正常工作了.

If you see "Database connection error (3): Could not connect to database" 在您的网站上出现错误信息,这通常意味着您连接到错误的 database server. 对于大多数Joomla安装,Joomla文件本身和 database 连接到同一台服务器. In such cases, "localhost" 应该用作 database server.

要修复该错误,请检查您的配置.PHP文件并确保您的 database host is set to “localhost”. 如果没有帮助,你可以检查你的 database 中的服务器名称。 phpMyAdmin 面板上方的顶部菜单. See the screenshot below:

joomla_database_connection_error1

  1. 蓝色标记的项目是 database server name.

  2. 绿色标记的项目是 database name.

你也可以收到 "显示错误页面错误:应用程序实例化错误:无法连接到。 MySQL" error message. 在这种情况下,您应该检查所有 database 配置详情.php file: database user, database password, database name and database server name. See the screenshot below:

joomla_database_connection_error2

本教程到此结束. 现在你知道如何修理了 database 连接错误.

请随时查看下面的详细视频教程:

Joomla排忧解难. 如何修复数据库连接错误

美丽的Joomla模板
这个条目被张贴了出来 Joomla! Tutorials and tagged connection, database, error, fix, joomla. Bookmark the permalink.

提交罚单

如果您仍然无法找到关于您的问题的足够的教程,请使用以下链接向我们的技术支持团队提交请求. 我们将在接下来的24小时内为您提供我们的帮助和协助: 提交罚单