Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Query Error #30

Open
90zm opened this issue Feb 24, 2024 · 4 comments
Open

Database Query Error #30

90zm opened this issue Feb 24, 2024 · 4 comments

Comments

@90zm
Copy link

90zm commented Feb 24, 2024

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

@benzBrake
Copy link
Owner

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

@90zm
Copy link
Author

90zm commented Feb 25, 2024

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
Copy link
Author

90zm commented Feb 25, 2024

好像是数据库没有办法创建,手动创建了表和 列,现在可以正常运行了。
`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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants