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

default table collation #6

Open
shoulders opened this issue Oct 2, 2019 · 6 comments
Open

default table collation #6

shoulders opened this issue Oct 2, 2019 · 6 comments
Assignees

Comments

@shoulders
Copy link

the default collations for the databases might need looking at.

for some reason my default database collation was set at latin1_swedish_ci and becasue of this 3 tables were set to this, but the jdbuilder_pages was set to utf8mb4_unicode. can you set explicit table collations for these 3 tables i.e. utf8_unicode_ci or if you must utf8_general_ci

database-collations

@chetanmadaan
Copy link
Member

@shoulders we need to keep collation to utf8mb4_unicode_ci since that'll allow the tables to store multibyte data including emoji's, Chinese language characters and others.

Newer version so Joomla's default tables are now utf8mb4_unicode_ci unless I am mistaken. I just checked #__content.

@shoulders
Copy link
Author

shoulders commented Oct 3, 2019

@chetanmadaan

Newer version so Joomla's default tables are now utf8mb4_unicode_ci unless I am mistaken. I just checked #__content.

This might just be for the core joomla tables. I cant speak directly about joomla but i know wordpress does a test to see if it can use utf8mb4 collation before it installs and if it can does use it, otherwise it defaults back to normal utf8. I would guess joomla 4 would be the same. I dont know about the install mechanism for the Joomla 4 to know whether it sets the collation or that the default collation for the database is used unless specfied in the mysql query. I think joomla 3 used the default databases collation though.

other way around. Keep utf8mb4_unicode_ci for the greater character range/emojis, this is fine.

It is the other tables I am concerned with. They would be better as utf8_unicode_ci or utf8_general_ci as this seems to be a standard collation and I am sure it is what wordpress uses for all of its tables when you do a default install.

as you can guess utf8_unicode_ci is the 3 byte version of utf8mb4_unicode_ci (4 byte)

when people have badly configured servers latin1_swedish_ci is used because this is the default collation. (p.s. I wish database developers would change this in their releases). Setting the collation for these tables prevents the wrong collation being used.

I dont know if you have a preference as to explicity set the collation or not. I personally manually change the tables to utf8_unicode_ci if I find any latin1_swedish_ci ones

@chetanmadaan
Copy link
Member

Thanks Jon for the through explanation. I am not an expert on this are and I'll do my research and then get back here.

@chetanmadaan chetanmadaan self-assigned this Oct 3, 2019
@shoulders
Copy link
Author

some notes i did a while ago, they might help.

https://quantumwarp.com/kb/articles/23-mysql/392-what-mysql-database-collation-should-i-use

@chetanmadaan
Copy link
Member

Thanks that's very helpful Jon.

@chetanmadaan
Copy link
Member

I read your post Jon and I think we'll keep utf8mb4_unicode_ci for _#_jdbuilder_layouts and _#_jdbuilder_templates and utf8_unicode_ci for the everything else.

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

3 participants