Results 1 to 10 of 10

Thread: connection could not be establieshed b/w qt and mysql

  1. #1
    Join Date
    Nov 2006
    Posts
    37
    Thanks
    1

    Default connection could not be establieshed b/w qt and mysql

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: connection could not be establieshed b/w qt and mysql

    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.

  3. #3
    Join Date
    Nov 2006
    Posts
    37
    Thanks
    1

    Default Re: connection could not be establieshed b/w qt and mysql

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: connection could not be establieshed b/w qt and mysql

    Quote Originally Posted by amit_pansuria View Post
    "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"?

  5. #5
    Join Date
    Nov 2006
    Posts
    37
    Thanks
    1

    Default Re: connection could not be establieshed b/w qt and mysql

    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

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: connection could not be establieshed b/w qt and mysql

    Quote Originally Posted by amit_pansuria View Post
    "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?

  7. #7
    Join Date
    Nov 2006
    Posts
    37
    Thanks
    1

    Default Re: connection could not be establieshed b/w qt and mysql

    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

  8. #8
    Join Date
    Nov 2006
    Posts
    37
    Thanks
    1

    Default Re: connection could not be establieshed b/w qt and mysql

    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

  9. #9
    Join Date
    Nov 2006
    Posts
    37
    Thanks
    1

    Default Re: connection could not be establieshed b/w qt and mysql

    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

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: connection could not be establieshed b/w qt and mysql

    Quote Originally Posted by amit_pansuria View Post
    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?

Similar Threads

  1. Connection to MySQL - windows
    By Peter34 in forum Qt Programming
    Replies: 18
    Last Post: 30th October 2006, 18:54
  2. Qt and MySQL Database Connection
    By shamik in forum Qt Programming
    Replies: 41
    Last Post: 6th October 2006, 12:48
  3. Qt 4.1.4 & Mysql 5 on Linux x64
    By bothapn in forum Installation and Deployment
    Replies: 7
    Last Post: 4th August 2006, 13:23
  4. connecting to MySQL through it's API
    By Philip_Anselmo in forum Installation and Deployment
    Replies: 20
    Last Post: 30th May 2006, 23:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.