PDA

View Full Version : connection could not be establieshed b/w qt and mysql



amit_pansuria
17th November 2006, 10:10
helo,
i m using qt-3.3.0 and mysql 5.0 on redhat 9
i build driver as given
root#cd /usr/local/qt/plugins/src/sqldriver/mysql
mysql#qmake -o Makefile "INCLUDEPATH+= -/usr/local/mysql/include" "LIBS+= -L/usr/lib/mysql -mysqlclient" mysql.pro
#make
it shows libqsqlmysql.so under sqldriver
after that i open qt designer and setup database connection
r giving all the detials like root ,user name ,port etc
when i press connection buttion then qt designer disupear
then i run ldd against libqsmysql.so
it shows the output as
warning: cannot find entry symbol -start ; not setting start address
libqsqlmysql.so :undefined reference to 'mysql_server_init'
libqsqlmysql.so :undefined reference to "mysql_server_end'

then i done rm-f libqsqlmysql.so and again install driver as
qmake -o makefile "INCLUDEPATH+= -/usr/local/mysql/include" "LIBS+= -L/usr/lib/mysql -mysqlclient.so
make
but i got the same result as given above.
what to do to solve this isse
Thanks in advance
Amit

wysota
17th November 2006, 10:56
I think Qt3 won't handle MySQL5 as the API in the latter changed between major versions. The driver would have to be rewritten for the new API.

amit_pansuria
17th November 2006, 11:53
helo Sir,
right now my current system at client side using this version of qt-3.3.0 and its correctly working and provide driver qmysql3.
Thx n Regards,
Amit

jacek
17th November 2006, 12:15
"INCLUDEPATH+= -/usr/local/mysql/include" "LIBS+= -L/usr/lib/mysql -mysqlclient"
Shouldn't it be "INCLUDEPATH+= /usr/local/mysql/include" "LIBS+= -L/usr/lib/mysql -lmysqlclient"?

amit_pansuria
17th November 2006, 14:48
helo
ya
its right path i given
qmake -o makefile "INCLUDEPATH+=/usr/local/mysql/include" "LIBS+=-L/usr/lib/mysql -lmysqlclient" mysql.pro
make
Thx n Regards,
Amit

jacek
17th November 2006, 15:47
"INCLUDEPATH+=/usr/local/mysql/include" "LIBS+=-L/usr/lib/mysql -lmysqlclient"
One more thing, you take headers from /usr/local/mysql, but the library itself from /usr/lib/mysql. Do you have only one version of MySQL client library? If not, shouldn't you use only one of these paths?

amit_pansuria
20th November 2006, 07:26
helo
i m showing the contents of both
(1) cd /usr/lib/mysql
ls
libdebug.a libmyisam.a libmysqlclient-r.a libmysqlclient_r.s0.10.0.0
libheap.a libmyisammrg.a libmysqlclient_r.so libmysqlclient.so
libmerge.a libmysqlclient.a libmysqlclient_r.so.10 libmysqlclient.s0.10

libmysqlclient.so.10.0.0 libnisam.a
libmystrings.a
libmysys.a


(2) cd /usr/local/mysql/lib
ls
libmysqlclient.a
libmysqlclient_r.a
libmysqld.a
lib mystrings.a
libmysys.a

i both cases directory cd /usr/local/qt/plugins/sqldriver shows the
libqsqlmysql.so
but still got the same probs again
so what to do now
Thx n Regards,
Amit

amit_pansuria
20th November 2006, 07:50
helo i m showing the
/usr/local/qt/plugins/sqldriver
ls
libqsqlmysql.so
now when i run ldd libqsqlmysql.so
it shows the following

libqt-mt.so.3 => /usr/local/qt/lib/libqt-mt.so.3 (0x4000e000)
libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x407b6000)
libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x407be000)
libXcursor.so.1 => /usr/X11R6/lib/libXcursor.so.1 (0x407c2000)
libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x407cc000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x407de000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x4082f000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40854000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40862000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40941000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x4094b000)
libdl.so.2 => /lib/libdl.so.2 (0x40962000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40965000)
libm.so.6 => /lib/tls/libm.so.6 (0x40a18000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40a3a000)
libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x40a43000)
libz.so.1 => /usr/lib/libz.so.1 (0x40a66000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x40a74000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x40ae7000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40afd000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x40b0a000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x40b2b000

amit_pansuria
21st November 2006, 06:22
helo i got sucess to make connection b/w qt and mysql
for that i reinstall qt and mysql
and given the path as
qmake -o Makefile "INCLUDEPATH+=/usr/local/qt/include" "LIBS+= -L/usr/local/mysql/lib -lmysqlclient" mysql.pro
then
make
when i connect through database it shwos the connection.
but still i have one dought that
when i run
cd /usr/local/qt/plugins/sqldriver
./libqsqlmysql then it shows segmentation fault
if u know why it happens then let me know
Thx n Regards,
Amit

jacek
21st November 2006, 14:24
cd /usr/local/qt/plugins/sqldriver
./libqsqlmysql then it shows segmentation fault
Do I understand you correctly that you have tried to run the plugin as an application?