[ZBX-6323] instructions should call for case sensitive mysql database Created: 2013 Feb 26 Updated: 2024 Apr 10 Resolved: 2017 Feb 17 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Documentation (D) |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Incident report | Priority: | Major |
Reporter: | richlv | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | casesensitivity, mysql, upgrade | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
||||||||||||||||
Team: | |||||||||||||||||
Sprint: | Sprint 1 |
Description |
(1) various problems arise from mysql db being case insensitive for most users. zabbix documentation should advise for mysql database to be case sensitive. a) installation instructions : b) upgrade notes for 2.2 should suggest this in https://www.zabbix.com/documentation/2.2/manual/installation/upgrade_notes_220 (and maybe corresponding 2.0 page) ALTER DATABASE zabbix DEFAULT CHARACTER SET utf8 COLLATE utf8mb4_bin; apparently, the second query above also adds utf8 charset for columns, but not collate. then default collate for that charset is used, not the one set for the table (as par http://dev.mysql.com/doc/refman/5.0/en/charset-column.html). the following works, but shows collate for all columns. that seems to be only displaying collate which is not the default for used charset (as opposed to it being different to the table collation). ALTER TABLE <table name> CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; it could be a shellscript like : (2) mysql will ignore trailing spaces for most operations, which can be a problem for zabbix (for example, ipmi sensors may have trailing space). using 'like' instead of '=' will do exact match. |
Comments |
Comment by Martins Valkovskis [ 2013 Feb 27 ] |
I'd say both 2.0 and 2.2 instructions should be changed, unless there are some good reasons against touching it in 2.0. <richlv> agreed, case insensitivity is causing various problems - but _bin collation should be extensively tested with zabbix zalex_ua I'd suggest to not touch 2.0 doc. |
Comment by Oleksii Zagorskyi [ 2013 Feb 27 ] |
|
Comment by richlv [ 2013 Mar 18 ] |
for the record, i've been using several of my test installs with utf8_bin for several weeks now, haven't seen any issue with that so far |
Comment by Antonio Salazar [ 2013 May 11 ] |
So far the only issue I've seen after the conversion to utf8_bin was that users could not login, probably because the user aliases were mixed-case. |
Comment by richlv [ 2014 Oct 24 ] |
installation notes have been updated, but suggestion to change was not added to upgrade notes. now it should probably added to upgrade notes for 2.2, 2.4 and 3.0 |
Comment by richlv [ 2015 Feb 13 ] |
it has been mentioned that adding everything from "b)" to upgrade notes would be too much - and that is true. a short version should be used instead. what exactly - any suggestions ? |
Comment by richlv [ 2016 Mar 06 ] |
...now it should probably added to upgrade notes for 2.2, 2.4, 3.0 and 3.2 |
Comment by Oleksii Zagorskyi [ 2016 Apr 28 ] |
https://dev.mysql.com/doc/mysql-utilities/1.5/en/mysqldbcompare.html |
Comment by Martins Valkovskis [ 2017 Feb 16 ] |
I have added a basic note to the upgrade notes for 2.0, 2.2, 2.4 and 3.0. 2.0 because that's the version we changed the database creation instructions in. It could be argued that having one note in 2.0 is enough. I think it's good to repeat it for a few versions, but we can't go on repeating this info infinitely either. |
Comment by richlv [ 2017 Feb 16 ] |
thanks, looks good to me. as for the versions, it might still be good to add to 3.2 and 3.4 upgrade notes. reasoning :
not suggesting to repeat it forever, 3.4 would be the last version to warn about this |
Comment by Martins Valkovskis [ 2017 Feb 17 ] |
Agreed, added to the 3.2 and 3.4 upgrade notes as well. |
Comment by richlv [ 2017 Feb 17 ] |
great, looks good - thank you |
Comment by Satchel [ 2017 Apr 28 ] |
Not sure if this is the appropriate place, but I was able to follow along with the docs here: https://confluence.atlassian.com/jirakb/how-to-change-all-columns-and-tables-collation-to-utf8_bin-in-mysql-601456761.html and get my medium-to-large sized installation migrated. This is an instance that's been upgraded from 2.0->2.4->3.0 and now 3.2 with success, origianlly created with utf8_general_ci. |
Comment by Joris Willems [ 2018 Jun 21 ] |
@Satchel Thanks for the link, the instructions work perfectly and fast compared to other methods. I migrated from latin1 without issues. |
Comment by Oleksii Zagorskyi [ 2020 Apr 23 ] |
|