Results 1 to 2 of 2

Thread: QSqlDatabase, MySql, Threads and Debugging environment

  1. #1
    Join Date
    Oct 2007
    Location
    Calgary area
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QSqlDatabase, MySql, Threads and Debugging environment

    I have some code that creates a number of runnables using a threadpool to access different tables in the database. These all work when not run from the debugger, when compiled in Debug or Release mode. But, if I run from the debugger these all fail. Keep in mind, this all works when NOT running from the debugger. So, the debugger is causing some interaction issue. Would anyone have any suggestions as to why this is happening?

    Here are the specific errors:

    "Database Error(2013): Lost connection to MySQL server during query QMYSQL: Unable to open database 'myDatabase'"
    "Database Error(2013): Lost connection to MySQL server during query QMYSQL: Unable to open database 'myDatabase'"
    "Database Error(2013): Lost connection to MySQL server during query QMYSQL: Unable to open database 'myDatabase'"
    Error: QSqlError("2013", "QMYSQL: Unable to open database 'myDatabase'", "Lost connection to MySQL server during query")
    Error: QSqlError("2013", "QMYSQL: Unable to open database 'myDatabase'", "Lost connection to MySQL server during query")
    "Database Error(2013): Lost connection to MySQL server during query QMYSQL: Unable to open database 'myDatabase'"
    Error: QSqlError("2013", "QMYSQL: Unable to open database 'myDatabase'", "Lost connection to MySQL server during query")
    "Database Error(2013): Lost connection to MySQL server during query QMYSQL: Unable to open database 'myDatabase'"
    Error: QSqlError("2013", "QMYSQL: Unable to open database 'myDatabase'", "Lost connection to MySQL server during query")
    Error: QSqlError("2013", "QMYSQL: Unable to open database 'myDatabase'", "Lost connection to MySQL server during query")
    "Database Error(2013): Lost connection to MySQL server at 'reading authorization packet', system error: 4 QMYSQL: Unable to connect"
    Error: QSqlError("2013", "QMYSQL: Unable to connect", "Lost connection to MySQL server at 'reading authorization packet', system error: 4")
    "Database Error(2013): Lost connection to MySQL server at 'reading authorization packet', system error: 4 QMYSQL: Unable to connect"
    Error: QSqlError("2013", "QMYSQL: Unable to connect", "Lost connection to MySQL server at 'reading authorization packet', system error: 4")
    "Database Error(2013): Lost connection to MySQL server at 'reading authorization packet', system error: 4 QMYSQL: Unable to connect"
    Error: QSqlError("2013", "QMYSQL: Unable to connect", "Lost connection to MySQL server at 'reading authorization packet', system error: 4")

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QSqlDatabase, MySql, Threads and Debugging environment

    Do you correctly open and close the database connection in each runnable?
    Does each runnable use a unique enough connection name?

    Cheers,
    _

Similar Threads

  1. How to set MySQL connection options using QSqlDatabase
    By Cyrano in forum Qt Programming
    Replies: 4
    Last Post: 11th October 2014, 22:41
  2. Remote Debugging Debug Build in Production Environment
    By brogrammer in forum Installation and Deployment
    Replies: 0
    Last Post: 6th September 2014, 04:28
  3. Replies: 0
    Last Post: 18th September 2011, 08:58
  4. QSqlDatabase default MySQL unix socket path
    By daggilli in forum Qt Programming
    Replies: 0
    Last Post: 21st September 2008, 19:55
  5. QSqlDatabase Mysql timeout versus PortScanner
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2008, 00:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.