Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with coding used by MySQL in a TCP conexion.

Problem with coding used by MySQL in a TCP conexion.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 842 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mauricio Oliveros
    wrote on last edited by
    #1

    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)
    {
    if(QSqlDatabase::isDriverAvailable("QMYSQL")){
    QSqlDatabase myDB = QSqlDatabase::addDatabase("QMYSQL");
    myDB.setHostName(S);
    myDB.setUserName(U);
    myDB.setPassword(P);
    if(myDB.open())
    return 0;
    else
    return 1;
    }
    else
    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:

    https://drive.google.com/file/d/0B-CJKFYsPPdZdkVUR0xPX05scTQ/edit?usp=sharing

    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

    https://drive.google.com/file/d/0B-CJKFYsPPdZSDBxcm5Zc2FDN1E/edit?usp=sharing

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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":http://qt-project.org/doc/qt-5/sql-driver.html

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved