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

DBD::mysql::db do failed: Illegal mix of collations #6

Closed
nntu opened this issue Jun 16, 2015 · 2 comments
Closed

DBD::mysql::db do failed: Illegal mix of collations #6

nntu opened this issue Jun 16, 2015 · 2 comments

Comments

@nntu
Copy link

nntu commented Jun 16, 2015

hi, sorry my english :)
my os: Linux app 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24) x86_64
mysql : 5.6
DATABASE ocsweb /*!40100 COLLATE 'utf8_general_ci' */
error : -e: DBD::mysql::db do failed: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' at /usr/local/share/perl/5.20.2/Apache/Ocsinventory/Server/Inventory/Cache.pm line 34

i find google and found: https://www.webgui.org/etcetera/dbdmysqlst-execute-failed-illegal-mix-of-collations/1
[mysqld]
default-character-set=utf8
character-set-server = utf8
collation-server = utf8_general_ci

[client]
default-character-set=utf8

so still faulty .
thanks

@gillesdubois
Copy link
Member

Hello, as your other issue i cannot reproduce this bug :

If you're sure that is a bug and not a configuration / installation problems you should re-post one issue with more details.
See this issue answer for more details on what you need to post for a quick and accurate reply => #7 .

Sorry for inconvenience you met.
Regards, Gilles Dubois.

@netexpertise
Copy link

Hi,
I got the exact same error

I didn't have too much time to troubleshoot which table was causing the problem so I looked for all tables containing the "cache" keyword since it is related to the cache.pm file.

  • groups_cache
  • hardware_osname_cache
  • registry_name_cache
  • registry_regvalue_cache
  • softwares_name_cache

I looked for the collation field setting with
mysql> show full columns from hardware_osname_cache;
| Field | Type | Collation | ...
| ID | ...
| OSNAME | varchar(255) | latin1_swedish_ci | ...

and converted them to utf8
ALTER TABLE hardware_osname_cache MODIFY OSNAME VARCHAR(255) COLLATE utf8_general_ci;
ALTER TABLE registry_name_cache MODIFY NAME VARCHAR(255) COLLATE utf8_general_ci;
ALTER TABLE registry_regvalue_cache MODIFY REGVALUE VARCHAR(255) COLLATE utf8_general_ci;
ALTER TABLE softwares_name_cache MODIFY NAME VARCHAR(255) COLLATE utf8_general_ci;

Errors in logs have gone away.
Those fields must have been created with your default Mysql collation property I suppose.

David

@BadouDream BadouDream mentioned this issue Oct 5, 2023
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