Error 1267 (HY000): Illegal mix of collations (utf8mb4_0900_ai_ci,COERCIBLE) and (utf8mb4_general_ci,COERCIBLE) for operation '=' #821
-
|
Describe the bug The query is: To Reproduce
Expected behavior |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
|
With some testing in MySQL Workbench... This works This fails with the error (also reported above): This works to setting collate on the string pass to where... When I change the query in the metric accordingly: I get a new error: |
Beta Was this translation helpful? Give feedback.
-
|
Hi @leeleahulkcs, This looks to me like a misconfiguration and not a bug, I'm happy to assist. 👍 Also, to specify the collation you can specify the connection parameter (using |
Beta Was this translation helpful? Give feedback.
-
|
I run sql_exporter with the docker image. Pulled latest today. The file The file |
Beta Was this translation helpful? Give feedback.
-
This is new to me and I have tried this, but without success. Without this setting (what I posted above), I get this error (the first error): When I add just When I add I've also tried this with success in MySQL Workbench, but it fails with the second error in the metric query: It seems to me, that I've found three different ways to resolve the |
Beta Was this translation helpful? Give feedback.
-
|
I'd keep that parameter that returns invalid syntax error for now. I still would like to see the configuration snippet from sql_exporter configuration file. This is where I expect the find the misconfiguration. Could you please share it? Just to add a bit more details:
Sometimes, it's about changing metric configuration on the sql_exporter side, sometimes it requires adjusting the query a bit. 🙂👍 |
Beta Was this translation helpful? Give feedback.
-
|
If it helps, I'm testing against |
Beta Was this translation helpful? Give feedback.
-
Yes. I have shared my configuration above. #820 (comment) |
Beta Was this translation helpful? Give feedback.
-
I've also tried casting resource_name to BINARY - both the select and where statements. This results in the second error happening and without having to specify any charset or collation values anywhere in the query or DSN. Do you have any other recommendations / ideas to try for the metric configuration or the query ? |
Beta Was this translation helpful? Give feedback.
-
|
@leeleahulkcs Apologies, I missed the previously shared snippet. 😅 I'll have a look today and let you know. 👍 |
Beta Was this translation helpful? Give feedback.
-
|
@leeleahulkcs, I think here's the issue:
What's changed:
Please note that parameters in my snippet aren't duplicated. Give it a try and let me know. 👍 |
Beta Was this translation helpful? Give feedback.
-
|
Thank you. That works. In fact, I read that part yesterday in the documentation, but I did fully make the connection between the documentation example and my use case. |
Beta Was this translation helpful? Give feedback.
@leeleahulkcs, I think here's the issue:
resource_nameis most likely the string.valuescolumns must be numbers (as of the Prometheus met…