Page 2 of 2 FirstFirst 12
Results 21 to 38 of 38

Thread: mysql 5 connection

  1. #21
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql 5 connection

    you have only odbc sqlite plugins installed, I don't see mysql driver.

  2. #22
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    So how do I install it?

    Renan

  3. #23
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql 5 connection

    Quote Originally Posted by jpn View Post
    You don't seem to have the MySQL plugin. See How to Build the QMYSQL Plugin on Windows.
    use this post

  4. #24
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    C:\Utils\Qt\4.4.0\src\plugins\sqldrivers>qmake -o Makefile "INCLUDEPATH+=C:\Utils\MySQL5\include" "LIBS+=C:\Utils\MySQL5\lib\opt\l
    ibmysql.dll" mysql.pro
    Cannot find file: mysql.pro.


    Renan

  5. #25
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql 5 connection

    libmysql.lib don't dll
    worng path, it should be like this
    cd %QTDIR%\src\plugins\sqldrivers\mysql

  6. #26
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    another error:

    C:\Utils\Qt\4.4.0\src\plugins\sqldrivers\mysql>qma ke -o Makefile "INCLUDEPATH+=C:\Utils\MySQL5\include" "LIBS+=C:\Utils\MySQL5\lib
    \opt\libmysql.lib" mysql.pro

    C:\Utils\Qt\4.4.0\src\plugins\sqldrivers\mysql>nma ke

    Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    Copyright (C) Microsoft Corporation. All rights reserved.

    C:\Utils\MicrosoftVisualStudio8\SDK\v2.0\Bin\nmake .exe -f Makefile.Debug all

    Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    Copyright (C) Microsoft Corporation. All rights reserved.

    rc -D_DEBUG -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_EDITION=QT_EDITION_DESKTOP -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FR
    OM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -fo tmp\obj\debug_shared\qsqlmysqld_resource.res qsql
    mysqld_resource.rc
    qsqlmysqld_resource.rc(4) : fatal error RC1015: cannot open include file 'winver.h'.
    NMAKE : fatal error U1077: 'C:\Utils\MicrosoftVisualStudio8\SDK\v2.0\Bin\rc.E XE' : return code '0x1'
    Stop.
    NMAKE : fatal error U1077: 'C:\Utils\MicrosoftVisualStudio8\SDK\v2.0\Bin\nmak e.exe' : return code '0x2'
    Stop.

    C:\Utils\Qt\4.4.0\src\plugins\sqldrivers\mysql>

  7. #27
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql 5 connection

    did you set INCLUDE & LIB for VS?

  8. #28
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    here is my PATH, if thats what you are asking:

    PATH

    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\sy stem32\WBEM;C:\Utils\python25\;C:\Utils\Qt\4.4.0\b in;C:\Utils\MicrosoftVisualStudio8\SDK\v2.0\Bin;C: \Utils\MicrosoftVisualStudio8\VC\bin;C:\Utils\Micr osoftVisualStudio8\VC;C:\Utils\MySQL5\bin

    Renan

  9. #29
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql 5 connection

    this is PATH variable and I asked INCLUDE and LIB variables, anyway you should set these variables you can copy them from
    VSDIR\Common7\Tools\vsvars32.bat

  10. #30
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    PATH:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\sy stem32\WBEM;C:\Utils\python25\;C:\Utils\Qt\4.4.0\b in;C:\Utils\MicrosoftVisualStudio8\SDK\v2.0\Bin;C: \Utils\MicrosoftVisualStudio8\VC\bin;C:\Utils\Micr osoftVisualStudio8\VC;C:\Utils\MySQL5\bin

    INCLUDE:
    C:\Utils\MicrosoftVisualStudio8\VC\ATLMFC\INCLUDE; C:\Utils\MicrosoftVisualStudio8\VC\INCLUDE;C:\Util s\MicrosoftVisualStudio8\VC\PlatformSDK\include;C: \Utils\MicrosoftVisualStudio8\SDK\v2.0\include

    LIB:
    C:\Utils\MicrosoftVisualStudio8\VC\ATLMFC\LIB;C:\U tils\MicrosoftVisualStudio8\VC\LIB;C:\Utils\Micros oftVisualStudio8\VC\PlatformSDK\lib;C:\Utils\Micro softVisualStudio8\SDK\v2.0\lib


    And here is the output again:

    C:\Utils\Qt\4.4.0\src\plugins\sqldrivers\mysql>qma ke -o Makefile "INCLUDEPATH+=C:\Utils\MySQL5\include" "LIBS+=C:\Utils\MySQL5\lib
    \opt\libmysql.lib" mysql.pro

    C:\Utils\Qt\4.4.0\src\plugins\sqldrivers\mysql>nma ke

    Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    Copyright (C) Microsoft Corporation. All rights reserved.

    C:\Utils\MicrosoftVisualStudio8\SDK\v2.0\Bin\nmake .exe -f Makefile.Debug all

    Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    Copyright (C) Microsoft Corporation. All rights reserved.

    rc -D_DEBUG -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_EDITION=QT_EDITION_DESKTOP -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FR
    OM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -fo tmp\obj\debug_shared\qsqlmysqld_resource.res qsql
    mysqld_resource.rc
    cl -c -nologo -Zm300 -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_EDITION=QT_EDITI
    ON_DESKTOP -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:
    \utils\Qt\4.4.0\include\QtCore" -I"c:\utils\Qt\4.4.0\include\QtCore" -I"c:\utils\Qt\4.4.0\include\QtSql" -I"c:\utils\Qt\4.4.0\incl
    ude\QtSql" -I"c:\utils\Qt\4.4.0\include" -I"c:\Utils\MySQL5\include" -I"c:\utils\Qt\4.4.0\include\ActiveQt" -I"tmp\moc\debug_share
    d" -I"." -I"c:\utils\Qt\4.4.0\mkspecs\win32-msvc2003" -Fotmp\obj\debug_shared\ @C:\DOCUME~1\Renan\CONFIG~1\Temp\nm94.tmp
    NMAKE : fatal error U1077: 'C:\Utils\MicrosoftVisualStudio8\VC\bin\cl.EXE' : return code '0xc0000135'
    Stop.
    NMAKE : fatal error U1077: 'C:\Utils\MicrosoftVisualStudio8\SDK\v2.0\Bin\nmak e.exe' : return code '0x2'
    Stop.

  11. #31
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    Anybody has any ideia why using a commercial version of QT, I got this error?

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

    Renan

  12. #32
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql 5 connection

    you set wrong QMAKESPEC, your QMAKESPEC=win32-msvc2003 but in you case (if you use 2005 VS) must be QMAKESPEC=win32-msvc2005

  13. #33
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    ok

    I changed my QMAKESPEC, but I still get some errors:

    Qt Code:
    1. Setting up a Qt environment...
    2. -- QTDIR set to C:\utils\Qt\4.4.0
    3. -- Added C:\utils\Qt\4.4.0\bin to PATH
    4. -- QMAKESPEC set to "win32-msvc2005"
    5. C:\utils\Qt\4.4.0>cd src\plugins\sqldrivers\mysql
    6.  
    7. C:\Utils\Qt\4.4.0\src\plugins\sqldrivers\mysql>qmake -o Makefile "INCLUDEPATH+=C:\Utils\MySQL5\include" "LIBS+=C:\Utils\MySQL5\lib
    8. \opt\libmysql.lib" mysql.pro
    9.  
    10. C:\Utils\Qt\4.4.0\src\plugins\sqldrivers\mysql>nmake
    11.  
    12. Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    13. Copyright (C) Microsoft Corporation. All rights reserved.
    14.  
    15. C:\Utils\MicrosoftVisualStudio8\SDK\v2.0\Bin\nmake.exe -f Makefile.Debug all
    16.  
    17. Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    18. Copyright (C) Microsoft Corporation. All rights reserved.
    19.  
    20. cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_EDI
    21. TION=QT_EDITION_DESKTOP -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_
    22. SUPPORT -I"c:\utils\Qt\4.4.0\include\QtCore" -I"c:\utils\Qt\4.4.0\include\QtCore" -I"c:\utils\Qt\4.4.0\include\QtSql" -I"c:\utils\
    23. Qt\4.4.0\include\QtSql" -I"c:\utils\Qt\4.4.0\include" -I"c:\Utils\MySQL5\include" -I"c:\utils\Qt\4.4.0\include\ActiveQt" -I"tmp\mo
    24. c\debug_shared" -I"." -I"c:\utils\Qt\4.4.0\mkspecs\win32-msvc2005" -Fotmp\obj\debug_shared\ @C:\DOCUME~1\Renan\CONFIG~1\Temp\nm13.
    25. tmp
    26. NMAKE : fatal error U1077: 'C:\Utils\MicrosoftVisualStudio8\VC\bin\cl.EXE' : return code '0xc0000135'
    27. Stop.
    28. NMAKE : fatal error U1077: 'C:\Utils\MicrosoftVisualStudio8\SDK\v2.0\Bin\nmake.exe' : return code '0x2'
    29. Stop.
    30.  
    31. C:\Utils\Qt\4.4.0\src\plugins\sqldrivers\mysql>
    To copy to clipboard, switch view to plain text mode 

    Renan
    Last edited by GuL; 8th August 2008 at 15:42.

  14. #34
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: mysql 5 connection

    did you try to build some application from examples?
    were they built normally?

  15. The following user says thank you to spirit for this useful post:

    GuL (11th August 2008)

  16. #35
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    From the examples that came from QT, no. But I was folloing a tutorial to learn QT

    http://maven.smith.edu/~thiebaut/tutorials/

    And the have compiled fine. This is the first Im trying to connect to a database.

    Renan

  17. #36
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    Thats interesting: I was with this problem the whole week, and now it worked.

    Here is what I did: uninstall MySQL, QT and QT VS Integration. Restart the computer, and then install them all again.

    This should do the job. I don't know why this had done it work, but it did. Maybe there is a bug somewhere. I don't know.

    Thanks to all that tryied to help.

    Renan

  18. #37

    Default Re: mysql 5 connection

    Quote Originally Posted by GuL View Post
    Thats interesting: I was with this problem the whole week, and now it worked.

    Here is what I did: uninstall MySQL, QT and QT VS Integration. Restart the computer, and then install them all again.

    This should do the job. I don't know why this had done it work, but it did. Maybe there is a bug somewhere. I don't know.

    Thanks to all that tryied to help.

    Renan
    Should it be done in some specific order?

  19. #38
    Join Date
    Aug 2008
    Location
    Porto Alegre
    Posts
    65
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mysql 5 connection

    I don't know for sure, but I did in this order:
    MySQL, QT and QT VS Integration.

    Uninstall and install in that order.

    Renan

Similar Threads

  1. MySQL currency storage problem
    By MarkoSan in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2008, 10:04
  2. mysql configuration with qt
    By bala in forum Installation and Deployment
    Replies: 3
    Last Post: 6th November 2007, 12:02
  3. qt4.3.1 mysql problem
    By twells55555 in forum Qt Programming
    Replies: 5
    Last Post: 8th October 2007, 22:26
  4. MySQL starting problem
    By shamik in forum General Discussion
    Replies: 5
    Last Post: 25th April 2007, 08:20
  5. Qt 4.1.4 & Mysql 5 on Linux x64
    By bothapn in forum Installation and Deployment
    Replies: 7
    Last Post: 4th August 2006, 14:23

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.