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

Add default_character_set options to mysql helpers #1840

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Thatoo
Copy link

@Thatoo Thatoo commented May 16, 2024

Update ynh_mysql_connect_as() helper to be able, when restoring a database, to specify --default-character-set="xxx", xxx being latin1 or utf8mb4

The problem

...

Solution

...

PR Status

...

How to test

...

Update ynh_mysql_connect_as() helper to be able, when restoring a database, to specify --default-character-set="xxx", xxx being latin1 or utf8mb4
@alexAubin
Copy link
Member

Can you elaborate on the motivation behind this exactly ?

@Thatoo
Copy link
Author

Thatoo commented May 18, 2024

Creating Dokos package, I need to be sure all character in database are in utf8mb4
So I copied what nextcloud does and then I thought that if nextcloud needs it and Dokos also, maybe other package maintainer might need it too.
https://github.com/YunoHost-Apps/nextcloud_ynh/blob/master/scripts/_ynh_mysql_connect_as.sh
and extract from install script :

# Set the user as admin
ynh_mysql_connect_as --user=$db_name --password="$db_pwd" --database=$db_name --default_character_set="utf8mb4" \
    <<< "INSERT INTO oc_group_user VALUES ('admin','$admin');"
# And delete admin user
exec_occ user:delete admin

@alexAubin alexAubin changed the title Update ynh_mysql_connect_as in mysql helper Add default_character_set options to mysql helpers May 19, 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
2 participants