Important: Please read the Qt Code of Conduct -

Problem with coding used by MySQL in a TCP conexion.

  • Hola everyone.!

    Greetings is my first time, sorry if my post was solved but I don't found it something above this.
    and sorry for my english too.

    I build this in Windows 7 and Linux Ubuntu 14.04

    @// Funcion para conexion a la BD
    int mysqlJobs::dbCheckConexion(QString S, QString U, QString P)
    QSqlDatabase myDB = QSqlDatabase::addDatabase("QMYSQL");
    return 0;
    return 1;
    return 2;

    When I build this, my function return 2. and my tcp connection al servidor is bad.

    Then I run Wireshark to see the anatomy packet that is sent for the QMYSQL Driver. and I see this:

    Please, look the Charset: latin1 COLLATE latin1_swedish_ci in the image...

    When I connect to my server with another mysql tool, like Mysql Workbench or Mysql Gui Tools and
    can log in without any problem. (sin problemas)

    But the packet coding used is other look the next image and see that coding used is UTF8

    How I can change this? am sure that my problem with my function is for this.

    Please help me with this problem.

    Gracias y Saludos.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Before being able to use the MySQL plugin you need to build it. You can search in this forum. The question has been answered many times. You also have the "sql driver guide":

    If you are using your distribution Qt you should also have a pre-built package for that.

Log in to reply