解决中 网页访问报错
服务启动正常,网页端访问时报错

12:18:07 ERROR: SQLSTATE[HY000] [1049] Unknown database 'zentao' in /opt/zbox/app/zentao/framework/base/router.class.php on line 2164, last called by /opt/zbox/app/zentao/framework/base/router.class.php on line 2115 through function connectByPDO.
in  /opt/zbox/app/zentao/framework/base/router.class.php  on line  2215  when visiting

禅道版本 12.3 源码包
操作系统 CentOS
客户端浏览器 Chrome

提问者: zkb512 悬赏: 10 日期: 2021-10-11 12:20:41 答案:2 点击:53
设置备注
答案列表
2021/10/11
您好,根据您的描述,具体的报错信息是提示前段系统找不到对应的数据库,导致无法正常连接的问题,需要确认一下,目前服务器上的MySQL服务状态;可以使用命令行登录访问下禅道数据库 查看下是否有zentao这个数据库呢
2021/10/11
[erp@jadev mysql]$ pwd
/opt/zbox/data/mysql
[erp@jadev mysql]$ ll
total 176188
-rw-rw---- 1 nobody 1000 16384 Oct 11 12:17 aria_log.00000001
-rw-rw---- 1 nobody 1000 52 Oct 11 12:17 aria_log_control
-rw-rw---- 1 nobody nobody 79691776 Oct 11 12:18 ibdata1
-rw-rw---- 1 nobody nobody 50331648 Oct 11 12:18 ib_logfile0
-rw-rw---- 1 nobody nobody 50331648 Oct 11 12:09 ib_logfile1
-rw-rw---- 1 nobody 1000 0 May 16 2017 multi-master.info
drwx------ 2 nobody 1000 4096 Apr 16 2020 mysql
drwx------ 2 nobody 1000 4096 Apr 28 2017 performance_schema
-rw-rw---- 1 nobody nobody 24576 Oct 11 12:18 tc.log
drwx------ 2 nobody nobody 4096 Sep 8 12:56 Z_README_TO_RECOVER
[erp@jadev mysql]$ sudo /opt/zbox/zbox restart
[sudo] password for erp:
Retart Apache success
Retart Mysql success
[erp@jadev mysql]$
mysql目录没有看到zentao、状态是正常的
2021/10/11
根据您反馈的信息,确实是没有zentao这个数据库了。另外,禅道数据库默认是没有这个Z_README_TO_RECOVER 库文件的,可以确认下是否有人操作过禅道服务器?禅道是新安装部署的呢还是之前一直有在使用,有相关数据呢?可以看下zentao/tmp/backup 这个目录下有没有最近的备份文件,可以使用这个备份文件的SQL恢复下数据库看下。
2021/10/11
[erp@jadev backup]$ ll
total 2679304
-rwxrwxrwx 1 nobody nogroup 6913462 Sep 1 00:30 202109010030228.code.zip.php
-rwxrwxrwx 1 nobody nogroup 323258804 Sep 1 00:30 202109010030228.file.zip.php
-rwxrwxrwx 1 nobody nogroup 12051024 Sep 1 00:30 202109010030228.sql.php
-rwxrwxrwx 1 nobody nogroup 6913462 Sep 2 00:30 202109020030239.code.zip.php
-rwxrwxrwx 1 nobody nogroup 323259042 Sep 2 00:30 202109020030239.file.zip.php
-rwxrwxrwx 1 nobody nogroup 12055659 Sep 2 00:30 202109020030239.sql.php
-rwxrwxrwx 1 nobody nogroup 6913462 Sep 3 00:31 202109030030563.code.zip.php
-rwxrwxrwx 1 nobody nogroup 323718058 Sep 3 00:31 202109030030563.file.zip.php
-rwxrwxrwx 1 nobody nogroup 12068397 Sep 3 00:30 202109030030563.sql.php
-rwxrwxrwx 1 nobody nogroup 6913462 Sep 4 00:31 202109040030584.code.zip.php
-rwxrwxrwx 1 nobody nogroup 324150318 Sep 4 00:31 202109040030584.file.zip.php
-rwxrwxrwx 1 nobody nogroup 12074478 Sep 4 00:30 202109040030584.sql.php
-rwxrwxrwx 1 nobody nogroup 6913462 Sep 5 00:31 202109050030593.code.zip.php
-rwxrwxrwx 1 nobody nogroup 324150318 Sep 5 00:31 202109050030593.file.zip.php
-rwxrwxrwx 1 nobody nogroup 12074705 Sep 5 00:30 202109050030593.sql.php
-rwxrwxrwx 1 nobody nogroup 6913462 Sep 6 00:31 202109060031004.code.zip.php
-rwxrwxrwx 1 nobody nogroup 324150318 Sep 6 00:31 202109060031004.file.zip.php
-rwxrwxrwx 1 nobody nogroup 12074932 Sep 6 00:31 202109060031004.sql.php
-rwxrwxrwx 1 nobody nogroup 6913462 Sep 7 00:30 202109070030250.code.zip.php
-rwxrwxrwx 1 nobody nogroup 324431347 Sep 7 00:30 202109070030250.file.zip.php
-rwxrwxrwx 1 nobody nogroup 12091151 Sep 7 00:30 202109070030250.sql.php
-rwxrwxrwx 1 nobody nogroup 6913462 Sep 8 00:30 202109080030254.code.zip.php
-rwxrwxrwx 1 nobody nogroup 324514811 Sep 8 00:30 202109080030254.file.zip.php
-rwxrwxrwx 1 nobody nogroup 12106479 Sep 8 00:30 202109080030254.sql.php
backup目录下是看到有SQL文件的,请问下有没有具体恢复的步骤,对linux不是特别熟悉
2021/10/12

您好,可以执行如下命令,查看mysql是否正常启动:

ss -tnp | grep mariadb

ss -lnp | grep mariadb