Hi,
I am getting an error on executing the below line in QT in MAC. Have installed mysql 5.6.23
The code is as below
m_drivername = "QMYSQL3";
ondb = QSqlDatabase::addDatabase(m_drivername);
When control reaches this line getting the below warning
QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use, all queries will cease to work.
QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_connection', old connection removed.
ondb.setHostName(m_hostName);
ondb.setDatabaseName(m_databasename);
ondb.setUserName(m_database_username);
ondb.setPassword(m_database_password);
if(!ondb.open())
{
qDebug()<<ondb.lastError();
}
lastError() prints ==> QSqlError("2049", "QMYSQL: Unable to connect", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)")
Kindly help to resolve this issue in QT in Mac
Bookmarks