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

Installer: Force Database UTF8 Collation #677

Closed
dakur opened this issue Feb 3, 2015 · 20 comments
Closed

Installer: Force Database UTF8 Collation #677

dakur opened this issue Feb 3, 2015 · 20 comments

Comments

@dakur
Copy link
Contributor

dakur commented Feb 3, 2015

Hi, we are running HumHub on Ubuntu 14.04 and asking for user authentication on LDAP running on Windows 2003 Server. But there is a problem with received information about the user - the lastname, which containts special national characters, is not imported correctly - it shows "kucha?" instead of "kuchař" in HumHub. Is there any possibility to set characters encoding, or something like that?

@jkuchar
Copy link
Contributor

jkuchar commented Feb 3, 2015

I'm @dakur college.

It looks like something more global than just LDAP issue. When I post a text on a wall there is the same issue.

ěščřžýáíéů becomes ?š??žýáíé?

It looks like wrong character-set in database.

  • There definitely should be utf-8, is there? If not why?
  • Shoudn't it be default in HumHub?
  • Tables should be created with utf8 encoding even if whaever database cofiguration is, am I right?

@dakur
Copy link
Contributor Author

dakur commented Feb 3, 2015

Then, maybe it is something wrong on our side, because this goes well on other installations. Will check it out.

@luke-
Copy link
Contributor

luke- commented Feb 9, 2015

Hmm, no problem here with special chars and ldap.

Are your tables Profile/User set to UTF8?

@jkuchar
Copy link
Contributor

jkuchar commented Feb 11, 2015

We will check this thing more deeply with @dakur next week. Probably there is some bug in installation script. Because it should ensure, that tables are created in utf8 (even if database configuration is whatever)

@dakur
Copy link
Contributor Author

dakur commented Feb 19, 2015

Ok, the problem was, that I did not follow the steps in installation guide about creating database. Instead, I've created user "humhub" and checked the option "create database with the same name as username" in phpMyAdmin. The default collation is "latin1_swedish_ci", so all HumHub tables were set in "latin1_swedish_ci".
BUT should not the HumHub installator check this out and set the right collation?

@jkuchar
Copy link
Contributor

jkuchar commented Feb 19, 2015

Or shouldn't installer stop installation and throw an error?

@jkuchar
Copy link
Contributor

jkuchar commented Feb 19, 2015

@dakur Please, could you update the issue title?

@luke- luke- changed the title LDAP: bad national characters in imported data Installer: Force Database UTF8 Collation Feb 19, 2015
@cboulanger
Copy link

I just found out about this problem and will need to convert our databases manually... Please address this issue before releasing v1.0!

@buddh4
Copy link
Contributor

buddh4 commented Jan 30, 2021

@luke- this can be closed?

@jkuchar
Copy link
Contributor

jkuchar commented Feb 1, 2021

Still think that this should at least throw an error. So user will not end up in broken state.

@buddh4
Copy link
Contributor

buddh4 commented Feb 1, 2021

Maybe we can add a prerequisite check for this. What do you think @luke- .

@luke-
Copy link
Contributor

luke- commented Feb 2, 2021

@buddh4 Yes, we may can also check table collations/engines in the test.

@luke-
Copy link
Contributor

luke- commented Feb 2, 2021

In the setup we have to do this check again separately, because the prerequisite check runs before.

It would also be good to make the port of the database configurable.
#158

In addition, a checkbox that creates the database directly, if possible, would also be a good thing.

@buddh4
Copy link
Contributor

buddh4 commented Feb 2, 2021

@luke- I've opened a seperate issue: #4818

@yurabakhtin
Copy link
Contributor

@luke- I have tested this:

  • Created a new DB with collection latin1_general_ci
  • Run install
  • The collation of the DB was converted to utf8mb4_unicode_ci and all tables were created with same utf8mb4_unicode_ci collection

It works like this because this migration 4ef22e1#diff-f5897f5c0c6fbea496d34d10efdda6c776f533755cf12156b69c76b21366ec7cR8

I have also tested an install without the migration, in such case all tables were created with latin1_general_ci, so the sample ěščřžýáíéů is stored as ?š??žýáíé.

@yurabakhtin
Copy link
Contributor

It would also be good to make the port of the database configurable. #158

Commit dd9a7a7:
port

@yurabakhtin
Copy link
Contributor

In addition, a checkbox that creates the database directly, if possible, would also be a good thing.

Commit 89e675e:

test_create_db

@luke-
Copy link
Contributor

luke- commented Feb 4, 2021

@yurabakhtin Looks good. Can you also check the collation?

@yurabakhtin
Copy link
Contributor

@luke-

Looks good. Can you also check the collation?

Sorry, but I don't understand what collation check you mean here.

If you tell about collation prerequisite check then I implemented this here #4818.

If you want some additional check during install then I tested the install into DB with wrong collection here #677 (comment), i.e. if DB has no collection utf8mb4 then such DB will be converted to utf8mb4 during install and all tables will be created in the same collation because of migration 4ef22e1#diff-f5897f5c0c6fbea496d34d10efdda6c776f533755cf12156b69c76b21366ec7cR8.

If this is not enough please give me more details where the collation check should be implemented, thanks.

@luke-
Copy link
Contributor

luke- commented Feb 5, 2021

Oh, that's right, I hadn't considered the migration. Then that is enough of course. Thanks!

@luke- luke- closed this as completed Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants