登录CWP控制面板的roundcude邮箱,出现以下错误提示 ▼
DATABASE ERROR: CONNECTION FAILED! Unable to connect to the database! Please contact your server-administrator.
检查roundcude 数据库错误问题
请检查roundcude错误日志文件 ▼
/usr/local/cwpsrv/var/services/roundcube/logs/errors
如果你的错误看起来像这样 ▼
[17-May-2021 20:18:11 +0000]: <gv4343g> DB Error: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES) in /usr/local/cwpsrv/var/services/roundcube/program/lib/Roundcube/rcube_db.php on line 173 (GET /roundcube/) [17-May-2021 20:18:11 +0000]: <gv4343g> DB Error: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES) (GET /roundcube/)
检查roundcube 配置文件
检查roundcube 配置文件中设置的密码 /usr/local/cwpsrv/var/services/roundcube/config/config.inc.php
grep db_dsnw /usr/local/cwpsrv/var/services/roundcube/config/config.inc.php
输出将像这样 ▼
$config['db_dsnw'] = 'mysqli://roundcube:42Etn3fd7skc@localhost/roundcube';
- 这表示的密码是
42Etn3fd7skc
现在让我们在MySQL中设置相同的值 ▼
mysql -e "SET PASSWORD FOR 'roundcube'@'localhost' = PASSWORD('42Etn3fd7skc');" mysql -e "FLUSH PRIVILEGES;"
检查roundcube是否有效?
现在,再次检查roundcube是否有效?
如果出现此错误 ▼
[17-May-2021 20:29:09 +0000]: <gv91fd30g> DB Error: [1146] Table 'roundcube.session' doesn't exist (SQL Query: SELECT `vars`, `ip`, `changed`, now() AS ts FROM `session` WHERE `sess_id` = 'gv93bfdsfdffdfdj3') in /usr/local/cwpsrv/var/services/roundcube/program/lib/Roundcube/rcube_db.php on line 539 (GET /roundcube/)
运行此命令 ▼
mysql -u root 'roundcube' < /usr/local/cwpsrv/var/services/roundcube/SQL/mysql.initial.sql
就是这样,享受你的 roundcude (圆角立方体)。
另外, 还有一种错误跟以上错误不同,解决和修复方法,请浏览下方文章链接 ▼
希望陈沩亮博客( https://www.chenweiliang.com/ ) 分享的《解决修复roundcude DATABASE ERROR: CONNECTION FAILED!》,对您有帮助。
欢迎分享本文链接:https://www.chenweiliang.com/cwl-1163.html
喜欢就分享和按赞!您的分享和按赞,是我们持续的动力!