donqo88682 2014-10-11 18:21
浏览 92

无法访问Drupal的MySQL数据库

I just installed an instance of Drupal on a shared web hosting account earlier today (via softaculous). I set some things different from how I wanted it the first time, so I deleted the directory it installed in, and the database and user that were created for it, and then tried again. Shortly after starting to work with the second install, I got the error described below, and I hadn't done much yet so I re-installed again. Now I'm on my third install, with all three using the same database and user name (I deleted the old MySQL database and user through cPanel before each install), and the same error is happening again.

When I try to access any of the drupal pages, I get this:

PDOException: SQLSTATE[HY000] [1045] Access denied for user
'mareofni_twocit'@'localhost' (using password: YES) in
lock_may_be_available() (line 167 of
home/mareofni/public_html/twocities/includes/lock.inc).

The "MySQL Databases" section of cPanel says that the database and user still exist. When I use the "check database" feature, it gives this error message:

Error from MySQL query: DBD::mysql::db do failed:
Unknown database 'mareofni_twocit'Failed to use
mareofni_twocit: Unknown database 'mareofni_twocit'

"Repair database" in cPanel doesn't fix the problem, and gives the same error message.

Error from MySQL query: DBD::mysql::db do failed:
Unknown database 'mareofni_twocit'Failed to use
mareofni_twocit: Unknown database 'mareofni_twocit'

I tried looking at the databse in phpMyAdmin, but phpMyAdmin doesn't list the database - like it can't tell that it exists.

Is there anything I can do to fix this problem myself, or prevent it happening again the next time I install Drupal? Some insight on what the problem is would also be helpful.

(Line breaks in the error messages are mine, added for readability.)

  • 写回答

1条回答 默认 最新

  • dsn1327 2014-10-12 01:33
    关注

    I've figured out that I cannot create database users who are able to drop databases, and the user I access phpMyAdmin through also cannot drop databases. Since phpMyAdmin couldn't find the database at all, I think the database must have been dropped or corrupted (rather than all the tables dropped or something).

    This can't be something that Drupal did, since the Drupal user didn't have permission to drop the database. (Unless Drupal managed to corrupt the database somehow; I don't know enough about how that works to be sure of whether it's possible.) I suspect there's a bug in cPanel, Softaculous, or some other software put there by the hosting company that caused it. Maybe it didn't like that I re-created the DB immediately after deleting it.

    I'm trying again with a different database name and crossing my fingers.

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器