gpt4 book ai didi

mysql - 无法在 WAMP 服务器上的 WordPress 本地主机中选择数据库错误

转载 作者:行者123 更新时间:2023-11-29 01:35:06 27 4
gpt4 key购买 nike

我正在关注这个 Lynda.com 教程(WordPress – 使用下划线从头开始构建主题 (2017)),但还没有走得太远。我使用 WAMP 服务器 在本地主机上安装了空白 WordPress 安装,并下载并安装了下划线主题。但由于某种原因,当我尝试启动该网站时,我收到此错误:

Can’t select database

We were able to connect to the database server (which means your username and password is okay) but not able to select the lynda_under17_040518 database.

Are you sure it exists?

Does the user root have permission to use the lynda_under17_040518 database? On some systems the name of your database is prefixed with your username, so it would be like username_lynda_under17_040518. Could that be the problem?

If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

这是我所知道的

  • 数据库存在,我可以在 phpMyAdmin 中对其运行 SQL 命令。
  • 我的用户是root
  • 主机是本地主机
  • 数据库为 lynda_under17_040518
  • root 拥有数据库的所有权限(已在 phpMyAdmin 中验证)
  • 同一 WAMPServer 上的其他本地网站工作正常

This Stack Overflow post说将 define( 'WP_DEBUG_LOG', true ); 放入 wp-config.php 中,我已经完成了。它还说:

“the debug.log file will be in wp-content.”

即使我重新启动了 WAMP 中的所有服务并刷新了浏览器,我也没有看到任何调试日志。

我查阅的其他链接

我查看了这些页面上的信息,但它们对我的情况并没有真正的帮助。

我的调试日志在哪里?如何让我的本地网站运行?

最佳答案

尽管 SQL 及其同类允许非常长的数据库名称,但许多应用程序(例如 cPanel)只能识别 16 个字符或更少的数据库名称。我怀疑您的数据库名称 (lynda_under17_040518) 太长,WAMP 和/或 WordPress 无法识别,如果缩短数据库名称,则可以正常工作。

关于mysql - 无法在 WAMP 服务器上的 WordPress 本地主机中选择数据库错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53402470/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com