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

[bug] 'typecho.typecho_email' does not exist. #11

Closed
JJJYmmm opened this issue Jul 20, 2024 · 1 comment
Closed

[bug] 'typecho.typecho_email' does not exist. #11

JJJYmmm opened this issue Jul 20, 2024 · 1 comment

Comments

@JJJYmmm
Copy link

JJJYmmm commented Jul 20, 2024

Environment

  • typecho 1.2.0
  • PHP 8.0
  • Nginx 1.20.2
  • MariaDB 10.5.15

Issue

发送邮件时提示typecho.typecho_email这张表不存在,看了一下Plugin.php中的dbInstall

CommentToMail/Plugin.php

Lines 245 to 251 in 07c5df1

$installDb = Db::get();
$type = array_pop(explode('_', $installDb->getAdapterName())); //数据库类型 mysql/sqlite/postgres
$prefix = $installDb->getPrefix(); //表前缀
$scripts = file_get_contents(__DIR__ . '/sql/' . $type . '.sql');
$scripts = str_replace('typecho_', $prefix, $scripts);
$scripts = str_replace('%charset%', 'utf8', $scripts);

发现是type字段的问题,我这里返回的type是mysqli而不是mysql

Solution

复制一份/sql下的Mysql.sql,重命名为Mysqli.sql

@soxft
Copy link
Owner

soxft commented Jul 22, 2024

好家伙,怎么变成 mysqli 了, 去改一下,感谢

@soxft soxft closed this as completed Jul 22, 2024
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