79643700

Date: 2025-05-29 10:04:48
Score: 4
Natty:
Report link

Problem solved.

My original code was:

m_Db.addDatabase("QMYSQL");

It have to be:

m_Db = QSqlDatabase::addDatabase("QMYSQL");

In the first case

bool ok = m_Db.open();

even if driver il correctly loaded.

Now I have a different proble, if I run directly the program, it is able to connect to the remote database. If I run it inside debugger, I receive this error:

"Open database failed: Can't create TCP/IP socket (10106) QMYSQL: Unable to connect"

Someone know how to configure debugger so to avoid this error?

Thank you.

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • RegEx Blacklisted phrase (1): I receive this error
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Riccardo Carassale