[Dbix-class] Multiple connections

Lianna Eeftinck liannaee at gmail.com
Thu Jan 16 19:20:21 GMT 2014


On 16/01/2014 16:44, Dave Howorth wrote:
> DBIx::Class::ResultSet::find(): DBI Exception: DBD::mysql::st execute
> failed: COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8'
>
> If you know how to avoid that, I'd be very happy to learn.
Sounds like a MySQL (library?) error rather than a DBI(C) problem. It 
sounds like that table has utf8 set as the character set but latin1 as 
the collation on at least one column and that's probably just not going 
to work.

The fix to solve that would really be to ALTER that table ...

> You'd have to back that assertion up with some detail (working code, 
> for example) for me to believe it :)
I think you'd have to come up with a more specific example problem 
first. Dealing with utf8 in general can be a bit of a pain. Without 
knowing exactly what is is you're doing and what issues you are running 
in to it's really only possible to give generic advice like in this 
post: http://stackoverflow.com/a/6192088

I've also found Devel::Peek to be quite helpful to troubleshoot what is 
going on with my strings.

> I think I already mentioned that the database is read-only.
Don't think you did, but that would make things awkward. Fixing the data 
in the database can be simple if it's a change from say latin1 to utf8 
... but hard if you can't write to the database.




More information about the DBIx-Class mailing list