I am trying to sync two databases using a local IP. Though I have the QMYSQL driver installed properly it still gives an error for connection failed.
A main database is created on host computer and I'm trying to sync data from another computer to this database through a local network.
Code on host computer:
db.setHostName("HOSTIP");
db.setDatabaseName("test");
db.setUserName("root");
db.setPassword("toor");
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL","Host");
db.setHostName("HOSTIP");
db.setDatabaseName("test");
db.setUserName("root");
db.setPassword("toor");
To copy to clipboard, switch view to plain text mode
Code on other computer:
db.setHostName("IP OF HOST");
db.setDatabaseName("test");
db.setUserName("root");
db.setPassword("toor");
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL","Other");
db.setHostName("IP OF HOST");
db.setDatabaseName("test");
db.setUserName("root");
db.setPassword("toor");
To copy to clipboard, switch view to plain text mode
Any help is appreciated!!
Bookmarks