Quote Originally Posted by Saurian View Post
Yes, I mean in which location. I want to be able to install this application on any PC and to work there. I want to compile it in Ubuntu too and be able there to make the application work. This is why I would need to know the location so I could zip the database with my application and all it's dll's.

I've wrote the next code:

Qt Code:
  1. QSqlDatabase db(QSqlDatabase::addDatabase("QMYSQL"));
  2.  
  3. //connect to database
  4. db.setHostName("localhost");
  5. db.setUserName("username");
  6. db.setPassword("password");
  7. db.setDatabaseName("database");
  8.  
  9.  
  10. if ( !db.open() )
  11. QMessageBox::critical(0, "Error", db.lastError().text());
  12. else
  13. QMessageBox::information(0, "OK", "Merge!!!");
To copy to clipboard, switch view to plain text mode 

and I get the following error box:

"QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7"

I've tried to copy libmysql.dll to the folder where my .exe file is and to my qtcreator.exe folder and it's still not working
First of all as I see You try to work with MySQL. To work with MySQL database You must install MySQL server and connect to them. Qt application is only a client. If You need to work with small database distributed with application use SQLite.
Second, standard Qt distribution don't contain MySQL driver. You have to build it yourself.