Hello masters of Zen and other programmers.

I have a problem with mysql database connection.

I wrote my code to using threads because the gui freeze when connecting and retrieving data from database. Everything seems fine and work as expected.
Unfortunately sometimes when I start application I have an error from connection to database:

Can't initialize character set latin1 (path: /usr/share/mysql/charsets/) QMYSQL: Unable to connect
I am confused. It's only happens sometimes but it is and I cannot let this to happens.

I don't know how to prevent this error to appears so please if anyone of you know something about it and how to fix it please help.