WordPress“建立数据库连接时出错”

     2023-02-25     39

关键词:

【中文标题】WordPress“建立数据库连接时出错”【英文标题】:WordPress 'Error establishing a database connection' 【发布时间】:2021-05-28 11:45:21 【问题描述】:

我正在尝试在WordPress 开始我的第一个项目并输入这些数据

    Database Namewp-project-1 DB_USERroot DB_PASSWORD:`` DB_HOST : localhost Table Prefix : wp_

在我的wp-config-sample.php:

define( 'DB_NAME', 'wp-project-1' );

/** MySQL database username */
define( 'DB_USER', 'root' );

/** MySQL database password */
define( 'DB_PASSWORD', '' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

但是当我提交它们时它会说这样的错误:

Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

Are you sure you have the correct username and password?
Are you sure you have typed the correct hostname?
Are you sure the database server is running?
If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

这里我使用的是xampp服务器,我的xampp端口号是3307(我改了,因为3306每次都很忙。)

我该如何解决?

【问题讨论】:

【参考方案1】:

请将您的 wp-config-sample.php 文件更改为 wp-config.php

【讨论】:

【参考方案2】:

在 xampp 上,您可以打开控制面板,其中显示 apache hit the config select php ini 并找到以下内容

mysqli.default_port=

【讨论】:

在 IIS 上托管 Wordpress 时建立数据库连接时出错

】在IIS上托管Wordpress时建立数据库连接时出错【英文标题】:ErrorestablishingadatabaseconnectionwhilehostingWordpressonIIS【发布时间】:2018-05-3114:28:48【问题描述】:当我使用WebPlatformInstaller安装wordpress时出现此错误。Errorestablishingadatabasecon... 查看详情

WordPress 建立数据库连接时出错 (xampp)

】WordPress建立数据库连接时出错(xampp)【英文标题】:WordPressErrorestablishingadatabaseconnection(xampp)【发布时间】:2017-07-0504:57:12【问题描述】:我正在使用xampp在本地托管我的网站。我正在使用来自xampp的MySQL数据库制作一个WordPress网... 查看详情

如何修复在“localhost/wordpress”上建立数据库连接时出错

】如何修复在“localhost/wordpress”上建立数据库连接时出错【英文标题】:HowtofixErrorestablishingadatabaseconnectionon"localhost/wordpress"【发布时间】:2017-02-1004:57:09【问题描述】:我已经为wordpress下载了XAMPP软件。下载后,当我尝... 查看详情

WordPress建立MySQL数据库连接IIS10时出错[重复]

】WordPress建立MySQL数据库连接IIS10时出错[重复]【英文标题】:WordPressErrorestablishingaMySQLdatabaseconnectionIIS10[duplicate]【发布时间】:2019-05-2712:18:16【问题描述】:我正在尝试在本地Windows10机器上使用MySQL设置WordPress。我收到此错误:... 查看详情

Wordpress - 建立数据库连接时出错 - 全新 WP 安装

】Wordpress-建立数据库连接时出错-全新WP安装【英文标题】:Wordpress-errorestablishingdatabaseconnection-freshWPinstall【发布时间】:2012-04-1219:56:45【问题描述】:我过去曾多次在本地安装和设置Wordpress主题,所以我对这个过程并不陌生。... 查看详情

建立数据库连接时出错:XAMPP WordPress

】建立数据库连接时出错:XAMPPWordPress【英文标题】:Errorestablishingadatabaseconnection:XAMPPWordPress【发布时间】:2017-07-1315:42:24【问题描述】:有很多关于此的文档,但我的故障排除失败了。我安装了适用于Windows的XAMPP,它工作正常... 查看详情

将 Wordpress 站点移动到 Docker:建立数据库连接时出错

】将Wordpress站点移动到Docker:建立数据库连接时出错【英文标题】:MovingWordpresssitetoDocker:ErrorestablishingDBconnection【发布时间】:2019-02-1015:47:25【问题描述】:我最近一直在使用Wordpress和Docker创建新站点,并且对它们的工作原理有... 查看详情

wordpress建立数据库连接时出错怎么办

在使用WordPress建站时,有时候站点会遇到”建立数据库连接时出错“的报错,整个站点都无法正常访问,如何修复这个错误呢?本文中来分享几个解决方法    方法一:重启数据库如果你是正常使用网站,在... 查看详情

建立数据库连接 Amazon EC2 时出错 - 移动我的 wordpress 博客后

】建立数据库连接AmazonEC2时出错-移动我的wordpress博客后【英文标题】:ErrorestablishingadatabaseconnectionAmazonEC2-aftermovingmywordpressblog【发布时间】:2011-11-1100:54:16【问题描述】:将我的wordpress博客移动到AmazonEC2后,我收到错误消息:... 查看详情

在 Kubernetes 上使用 Wordpress、MySQL、Nginx “建立数据库连接时出错”

】在Kubernetes上使用Wordpress、MySQL、Nginx“建立数据库连接时出错”【英文标题】:"Errorestablishingadatabaseconnection"usingWordpress,MySQL,NginxonKubernetes【发布时间】:2019-06-2401:26:19【问题描述】:我正在Kubernetes上使用Wordpress、php-fpm... 查看详情

XAMPP WordPress 全新“重新安装” - 建立数据库连接时出错

】XAMPPWordPress全新“重新安装”-建立数据库连接时出错【英文标题】:XAMPPWordPressfresh"re-install"-Errorestablishingadatabaseconnection【发布时间】:2019-02-1613:23:26【问题描述】:所以,我把事情搞砸了。我已经研究过这个主题,但... 查看详情

优胜美地升级后本地 WordPress 环境中“建立数据库连接时出错”

】优胜美地升级后本地WordPress环境中“建立数据库连接时出错”【英文标题】:"Errorestablishingadatabaseconnection"inlocalWordPressenvironmentafterYosemiteupgrade【发布时间】:2014-12-1602:12:40【问题描述】:升级到Yosemite改变了我的本地... 查看详情

“建立数据库连接时出错” MariaDB 已停止工作 - 由 Bitnami localhost 打包的 Wordpress

...据库连接时出错”MariaDB已停止工作-由Bitnamilocalhost打包的Wordpress【英文标题】:"Errorestablishingadatabaseconnection"MariaDBhasstoppedworking-WordpressPackagedbyBitnamilocalhost【发布时间】:2022-01-1316:20:17【问题描述】:我安装了由Bitnami打... 查看详情

从 localhost 开发站点时更改了 WordPress 地址 (URL) 和站点地址 (URL)。现在,建立数据库连接时出错

】从localhost开发站点时更改了WordPress地址(URL)和站点地址(URL)。现在,建立数据库连接时出错【英文标题】:ChangedWordPressAddress(URL)andSiteAddress(URL)whendevelopingsitefromlocalhost.Now,errorestablishingadatabaseconnection【发布时间】:2020-09-2715:46:29... 查看详情

为啥wordpress建立数据库连接时出错

...是由于没有正确配置数据库信息导致的,此时,我们更正WordPress的配置文件打开宝塔面板,选择文件,进入到网站目录,一般情况下为/www/wwwroot/domain.com在根目录下,找到名为wp-config.php的配置文件,点击编辑把数据库信息更正为... 查看详情

“建立数据库连接时出错”是啥意思

...思【发布时间】:2011-12-1816:55:34【问题描述】:我有一个wordpress博客名称http://shareprogrammingtips.com/它托管在hostgator上并且工作正常。但突然间我收到了类似的错误数据 查看详情

本地 WP 开发 - 建立数据库连接时出错

...述】:我正在使用LinuxMint13(基于Ubuntu12.04)并尝试安装WordPress生产项目的本地开发环境,该项目现在位于亚马逊EC2实例中。首先,我从它的bitbucket存储库中克隆了WP项目。之后,我 查看详情

在我的本地主机中建立数据库连接时出错

...8【问题描述】:我正在尝试在我的本地Xampp服务器中安装Wordpress但每次我收到一条错误消息建立数据库连接时出错。这要么意味着您的用户名和密码信息wp-config.php文件不正确或我们无法联系数据库本地主机上的服务器。这可能... 查看详情