benzBrake / ShortLinks

Typecho外链转内链插件,支持正文和评论者链接
http://doufu.ru
183 stars 31 forks source link

Database Query Error #30

Open 90zm opened 9 months ago

90zm commented 9 months ago

激活插件后显示这个是什么原因哇!

benzBrake commented 9 months ago

开启调试模式 给出具体报错

90zm commented 9 months ago

`Table 'typecho.typecho_shortlinks' doesn't exist Typecho\Db\Adapter\SQLException: Table 'typecho.typecho_shortlinks' doesn't exist in /home/wwwroot/lnmp01/domain/[域名]/web/var/Typecho/Db/Adapter/Mysqli.php:114 Stack trace:

0 /home/wwwroot/lnmp01/domain/[域名]/web/var/Typecho/Db.php(391): Typecho\Db\Adapter\Mysqli->query('SELECT target...', Object(mysqli), 1, 'SELECT', 'typecho_shortli...')

1 /home/wwwroot/lnmp01/domain/[域名]/web/var/Typecho/Db.php(440): Typecho\Db->query(Object(Typecho\Db\Query))

2 /home/wwwroot/lnmp01/domain/[域名]/web/usr/plugins/ShortLinks/Action.php(162): Typecho\Db->fetchRow(Object(Typecho\Db\Query))

3 /home/wwwroot/lnmp01/domain/[域名]/web/usr/plugins/ShortLinks/Action.php(107): ShortLinks_Action->getTarget('aHR0cHM6Ly9naXR...')

4 /home/wwwroot/lnmp01/domain/[域名]/web/var/Typecho/Router.php(99): ShortLinks_Action->shortlink()

5 /home/wwwroot/lnmp01/domain/[域名]/web/index.php(23): Typecho\Router::dispatch()

6 {main}`

您好,这是报错信息。[域名]做了替换。

90zm commented 9 months ago

好像是数据库没有办法创建,手动创建了表和 列,现在可以正常运行了。 `USE typecho;

CREATE TABLE typecho_shortlinks ( id int(10) UNSIGNED NOT NULL AUTO_INCREMENT, short_key varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, target_url varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (id), UNIQUE KEY short_key (short_key) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ALTER TABLE typecho_shortlinks ADD COLUMN target VARCHAR(255) NOT NULL; ALTER TABLE typecho_shortlinks ADD COLUMN key VARCHAR(255) NOT NULL; `

benzBrake commented 9 months ago

你是什么环境,什么数据库,数据库用户有没有建表权限