简体   繁体   English

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

[英]XAMPP WordPress fresh "re-install" - Error establishing a database connection

So, I mucked things up pretty good.所以,我把事情搞砸了。 I've researched this topic, but none of the solutions I found work or quite fit my situation.我已经研究过这个主题,但我发现没有一个解决方案有效或非常适合我的情况。

Let me explain.让我解释。 I had somehow managed to get a local install of WordPress using Xampp onto my Win10 PC.我以某种方式设法在我的 Win10 PC 上使用 Xampp 本地安装了 WordPress。 I remember it was a struggle then and that was a week ago.我记得那是一场斗争,那是一周前。 Problem is that I forgot my admin password and I couldn't figure out a way around it.问题是我忘记了我的管理员密码,我想不出解决办法。 So...所以...

  1. I did a database drop in phpmysql and recreated the wp table.我在 phpmysql 中做了一个数据库删除并重新创建了 wp 表。
  2. I copied the wp_config.php file into a safe place.我将 wp_config.php 文件复制到一个安全的地方。
  3. I deleted the wordpress folder in c:/xampp/htdocs.我删除了 c:/xampp/htdocs 中的 wordpress 文件夹。
  4. I downloaded a fresh copy of WordPress and extracted it to c:/xampp/htdocs/wordpress.我下载了 WordPress 的新副本并将其解压缩到 c:/xampp/htdocs/wordpress。
  5. I copied the old wp_config.php file into the newly re-created folder.我将旧的 wp_config.php 文件复制到新创建的文件夹中。
  6. I ran WordPress install and got to the screen where it says it's installed and here's your user name.我运行了 WordPress install 并进入了显示已安装的屏幕,这是您的用户名。
  7. I clicked on the link to the Login screen.我点击了登录屏幕的链接。

That's when I got the message -- Error establishing a database connection.就在那时我收到消息——建立数据库连接时出错。

I'm not sure how that's possible considering it was just connected and created all the tables in the database.考虑到它刚刚连接并创建了数据库中的所有表,我不确定这怎么可能。

Here's what's in my wp_config.php file, though I'm not sure what could be wrong with it since it was working fine a second ago (:{):这是我的 wp_config.php 文件中的内容,虽然我不确定它有什么问题,因为它在一秒钟前工作正常(:{):

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wp');

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

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

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

I'm sure someone can tell me where I went wrong and hopefully how to fix it.我相信有人可以告诉我哪里出错了,并希望如何解决它。 I'm fine with starting over again.我可以重新开始。 I just want to get it installed so I can learn the inner-workings.我只是想安装它,这样我就可以了解内部工作原理。 ;P ;P

Thanks in advance.提前致谢。 I look forward to learning from you all.我期待着向大家学习。 Jen

仅供参考,我最终卸载了 Xampp 并重新安装以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM