stas@stas-desktop:~/qtsdk-2010.02/qt/src/plugins/sqldrivers/mysql$ makeg++ -c -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -Wall -W -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtSql -I/usr/include/qt4 -I/usr/local/include -I. -o main.o main.cppIn file included from main.cpp:44:../../../sql/drivers/mysql/qsql_mysql.h:52: fatal error: mysql.h: Нет такого файла или каталогаcompilation terminated.make: *** [main.o] Ошибка 1
stas@stas-desktop:~/qtsdk-2010.02/qt/src/plugins/sqldrivers/mysql$ sudo make installinstall -m 755 -p "libqsqlmysql.so" "/usr/lib/qt4/plugins/sqldrivers/libqsqlmysql.so"strip --strip-unneeded "/usr/lib/qt4/plugins/sqldrivers/libqsqlmysql.so"stas@stas-desktop:~/qtsdk-2010.02/qt/src/plugins/sqldrivers/mysql$
QSqlDatabase: QMYSQL driver not loadedQSqlDatabase: available drivers: QSQLITE QSQLITE2Error occured in connection to database
#ifndef DATA_BASE_USE_H#define DATA_BASE_USE_H#include "mainwindow.h"void MainWindow::connecting_data_base(){ QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); db.setHostName(host_name->text()); db.setDatabaseName(database_name->text()); db.setUserName(user_name->text()); db.setPassword(password_base->text()); if (db.open()) { qDebug("connected to database"); } else { qDebug("Error occured in connection to database"); }}#endif // DATA_BASE_USE_H
# -------------------------------------------------# Project created by QtCreator 2011-01-13T19:05:29# -------------------------------------------------QT += sqlTARGET = MyDBTEMPLATE = appSOURCES += main.cpp \ mainwindow.cppHEADERS += mainwindow.h \ data_base_use.hFORMS += mainwindow.ui