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

Newly installed instance could use incorrect "utf8" charset for MySQL #25378

Closed
wxiaoguang opened this issue Jun 20, 2023 · 4 comments · Fixed by #25413
Closed

Newly installed instance could use incorrect "utf8" charset for MySQL #25378

wxiaoguang opened this issue Jun 20, 2023 · 4 comments · Fixed by #25413
Labels
Milestone

Comments

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 20, 2023

A default install could produce such app.ini:

APP_NAME=Gitea: Git with a cup of tea
RUN_USER=xiaoguang
RUN_MODE=prod

[database]
DB_TYPE=mysql
HOST=127.0.0.1:3306
NAME=gitea
USER=gitea
PASSWD=gitea
SCHEMA=
SSL_MODE=disable

CHARSET=utf8     !!!!!!!!!!!! wrong here

PATH=/Users/xiaoguang/work/gitea/data/gitea.db
LOG_SQL=false

"utf8mb4" is required for MySQL to work with emoji.

@wxiaoguang wxiaoguang added this to the 1.20.0 milestone Jun 20, 2023
lunny pushed a commit that referenced this issue Jun 21, 2023
In modern days, there is no reason to make users set "charset" anymore.

Close #25378

## ⚠️ BREAKING

The key `[database].CHARSET` was removed completely as every newer
(>10years) MySQL database supports `utf8mb4` already.
There is a (deliberately) undocumented new fallback option if anyone
still needs to use it, but we don't recommend using it as it simply
causes problems.
@wxiaoguang
Copy link
Contributor Author

Keep it open for 1.20 .... it's a serious problem now ....

@wxiaoguang wxiaoguang reopened this Jun 22, 2023
@lunny
Copy link
Member

lunny commented Jun 22, 2023

Could you backport #25413 ?

@wxiaoguang
Copy link
Contributor Author

There is a separate PR #25432 for 1.20, while I do not understand why there was objection for backporting #25413 or what's the difference between them.

@lunny
Copy link
Member

lunny commented Jun 22, 2023

There is a separate PR #25432 for 1.20, while I do not understand why there was objection for backporting #25413 or what's the difference between them.

Now I can understand backporting #25413 will not break too much.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants