Hi,
I am trying to connect MySql database using an SSL connection. Connecting without SSL works fine.
I created a database and a user with REQUIRE SSL option. When I try to connect I get: "SSL connection error QMYSQL: Unable to connect".
I am using Qt 4.7 64 bit on Ubuntu 10.04
The code looks like the following:
if (!db.isValid())
{
return;
}
db.setDatabaseName(dbName);
db.setHostName("localhost");
db.setPort(3306);
db.setConnectOptions("CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1");
if (!db.open(userName, password))
{
qDebug()<<db.lastError().text();
return;
}
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL", m_connName);
if (!db.isValid())
{
return;
}
db.setDatabaseName(dbName);
db.setHostName("localhost");
db.setPort(3306);
db.setConnectOptions("CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1");
if (!db.open(userName, password))
{
qDebug()<<db.lastError().text();
return;
}
To copy to clipboard, switch view to plain text mode
Was anyone able to work using this setup before?
Thank you
Bookmarks