Results 1 to 13 of 13

Thread: MySQL plugin

  1. #1
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default MySQL plugin

    Has anyone successfully built the mysql plugin for the Windows open source version using MinGW?

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    yep!
    What's your problem? Did you try passing related parameters to configure.exe?
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    Quote Originally Posted by fullmetalcoder
    yep!
    What's your problem? Did you try passing related parameters to configure.exe?
    I followed these directions:
    ##########
    The configure script cannot detect the neccessary libraries and include files if they are not in the standard paths, so it may be necessary to specify these paths using the -I and -L command-line options. For example, if your MySQL include files are installed in /usr/local/mysql (or in C:\mysql\include on Windows), then pass the following parameter to configure: -I/usr/local/mysql (or -I C:\mysql\include for Windows).
    On Windows the -I parameter doesn't accept spaces in filenames, so use the 8.3 name instead; for example, use C:\progra~1\mysql instead of C:\Program Files\mysql.
    Use the -qt-sql-<driver> parameter to build the database driver statically into your Qt library or -plugin-sql-<driver> to build the driver as a plugin. Look at the sections that follow for additional information about required libraries.
    #############
    and also tried these:
    #############
    You need to get the MySQL installation files. Run SETUP.EXE and choose "Custom Install". Install the "Libs & Include Files" Module. Build the plugin as follows (here it is assumed that MySQL is installed in C:\MYSQL):
    cd %QTDIR%\src\plugins\sqldrivers\mysql
    qmake -o Makefile "INCLUDEPATH+=C:\MYSQL\INCLUDE" "LIBS+=C:\MYSQL\LIB\OPT\LIBMYSQL.LIB" mysql.pro
    nmake
    If you are not using a Microsoft compiler, replace nmake with make in the line above.
    #############
    I have mysql installed to "C:\mysql", and chose to install headers and libraries during the install....

    What am I missing?

  4. #4
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    Quote Originally Posted by ksqt
    I followed these directions:
    ##########
    The configure script cannot detect the neccessary libraries and include files if they are not in the standard paths, so it may be necessary to specify these paths using the -I and -L command-line options. For example, if your MySQL include files are installed in /usr/local/mysql (or in C:\mysql\include on Windows), then pass the following parameter to configure: -I/usr/local/mysql (or -I C:\mysql\include for Windows).
    On Windows the -I parameter doesn't accept spaces in filenames, so use the 8.3 name instead; for example, use C:\progra~1\mysql instead of C:\Program Files\mysql.
    Use the -qt-sql-<driver> parameter to build the database driver statically into your Qt library or -plugin-sql-<driver> to build the driver as a plugin. Look at the sections that follow for additional information about required libraries.
    #############
    and also tried these:
    #############
    You need to get the MySQL installation files. Run SETUP.EXE and choose "Custom Install". Install the "Libs & Include Files" Module. Build the plugin as follows (here it is assumed that MySQL is installed in C:\MYSQL):
    cd %QTDIR%\src\plugins\sqldrivers\mysql
    qmake -o Makefile "INCLUDEPATH+=C:\MYSQL\INCLUDE" "LIBS+=C:\MYSQL\LIB\OPT\LIBMYSQL.LIB" mysql.pro
    nmake
    If you are not using a Microsoft compiler, replace nmake with make in the line above.
    #############
    I have mysql installed to "C:\mysql", and chose to install headers and libraries during the install....

    What am I missing?
    -I"c:\Program Files\..." should work AFAIK
    I'm using mingw32 and everything is fine. Dunno how to solve your case....
    Current Qt projects : QCodeEdit, RotiDeCode

  5. #5
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    What verion of MySQL are you using?
    What is the path?
    Are you using MinGW with open source version?
    Can you tell me exactly your commands to build Qt with the mysql plugin?

    Thanks...

  6. #6
    Join Date
    Jan 2006
    Location
    Ukraine, L'viv
    Posts
    57
    Thanks
    3
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    Quote Originally Posted by ksqt
    Has anyone successfully built the mysql plugin for the Windows open source version using MinGW?
    If you have no mingw-utils installed - install it. Then in %MYSQLDIR%\lib\opt do reimp libmysql.lib. Then go to %QTDIR%\src\plugins\sqldrivers\mysql and do
    qmake -o Makefile "INCLUDEPATH+=C:\MYSQL\INCLUDE" "LIBS+=C:\MYSQL\LIB\OPT\liblibmysql.a" mysql.pro
    Note for double lib! reimp creates such file.
    Then make.
    Then be happy

  7. The following 3 users say thank you to L.Marvell for this useful post:

    ksqt (11th April 2006), sector (8th October 2006), timmyg (26th February 2008)

  8. #7
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    mingw-utils <---- where do I get this, and where to check if I already have?

  9. #8
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    Quote Originally Posted by L.Marvell
    If you have no mingw-utils installed - install it. Then in %MYSQLDIR%\lib\opt do reimp libmysql.lib. Then go to %QTDIR%\src\plugins\sqldrivers\mysql and do

    Note for double lib! reimp creates such file.
    Then make.
    Then be happy
    Cool, thanks...!
    I now have a qsqlmysql.dll in \plugins\sqldrivers

    Why the directions do not point out your instructions, as they do not work as written?

  10. #9
    Join Date
    Jan 2006
    Location
    Ukraine, L'viv
    Posts
    57
    Thanks
    3
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    Quote Originally Posted by ksqt
    Why the directions do not point out your instructions, as they do not work as written?
    In some cases TT instructions work properly in some no. Maybe it depends on MySQL version, I don't really know.

  11. #10
    Join Date
    Jan 2006
    Location
    Ukraine, L'viv
    Posts
    57
    Thanks
    3
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    Quote Originally Posted by L.Marvell
    In some cases TT instructions work properly in some no. Maybe it depends on MySQL version, I don't really know.
    Oops. Mistake. TTs method works good under Linux but not under Windows.

  12. #11
    Join Date
    Mar 2006
    Posts
    58
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: MySQL plugin

    Now that mysql is working, here is what I wanted to do....

    A mysql database table will be populated with Bulgarian words(cyrillic) and English words via web browser, using in a form:
    Qt Code:
    1. <form action="<?php echo $_SERVER[PHP_SELF] ?>" method="post" accept-charset="utf-8">
    To copy to clipboard, switch view to plain text mode 

    I can then read the cyrillic words in a web browser, but in my qt app, the cyrillic words come out garbled(strange characters).

    Can anyone point me in the direction needed to be able to render the cyrillic characters?

    Edit.....
    Patching ".....\src\sql\drivers\mysql\qsql_mysql.cpp"
    in this function
    Qt Code:
    1. static QTextCodec* codec(MYSQL* mysql)
    2. {
    3. #if MYSQL_VERSION_ID >= 32321
    4. QTextCodec* heuristicCodec = QTextCodec::codecForName(mysql_character_set_name(mysql));
    5. if (heuristicCodec)
    6. return heuristicCodec;
    7. #endif
    8. return QTextCodec::codecForLocale();
    9. }
    To copy to clipboard, switch view to plain text mode 
    to this
    Qt Code:
    1. static QTextCodec* codec(MYSQL* mysql)
    2. {
    3. return QTextCodec::codecForName("UTF-8");
    4. }
    To copy to clipboard, switch view to plain text mode 
    and again following directions given by "L.Marvell" accomplished my goal....

    Thanks to a "Fanda" from the qt-interest mail group list for pointing me to this function.
    Last edited by ksqt; 11th April 2006 at 18:40.

  13. #12
    Join Date
    Aug 2007
    Location
    Nicaragua -Central America-
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: MySQL plugin

    Help!!!!!!!
    I try, try and try and i can't create the plugin for mysql, help me please

    C:\PROGRA~1>cd mysql

    C:\PROGRA~1\MySQL>cd mysqls~1.0

    C:\PROGRA~1\MySQL\MYSQLS~1.0>cd lib\opt

    C:\PROGRA~1\MySQL\MYSQLS~1.0\lib\opt>reimp libmysql.lib

    C:\PROGRA~1\MySQL\MYSQLS~1.0\lib\opt>cd \qt

    C:\Qt>cd 4.3.0

    C:\Qt\4.3.0>cd src

    C:\Qt\4.3.0\src>cd plugins

    C:\Qt\4.3.0\src\plugins>cd sqldrivers

    C:\Qt\4.3.0\src\plugins\sqldrivers>cd mysql

    C:\Qt\4.3.0\src\plugins\sqldrivers\mysql>qmake
    ^C
    C:\Qt\4.3.0\src\plugins\sqldrivers\mysql> qmake -o Makefile "INCLUDEPATH+=C:\PRO
    GRA~1\MYSQL\MYSQLS~1.0\INCLUDE" "LIBS+=C:\PROGRA~1\MYSQL\MYSQLS~1.0\LIB\OPT\li bl
    ibmysql.a" mysql.pro

    C:\Qt\4.3.0\src\plugins\sqldrivers\mysql>make
    mingw32-make -f Makefile.Release
    Makefile.Release:116: *** multiple target patterns. Stop.
    mingw32-make[1]: Entering directory `C:/Qt/4.3.0/src/plugins/sqldrivers/mysql'
    mingw32-make[1]: Leaving directory `C:/Qt/4.3.0/src/plugins/sqldrivers/mysql'
    mingw32-make: *** [release] Error 2

    C:\Qt\4.3.0\src\plugins\sqldrivers\mysql>

  14. #13
    Join Date
    May 2009
    Posts
    129

    Default Re: MySQL plugin

    Hi Marvell

    I am trying to create a plugin for Mysql

    I did ,what u have mentioned in above replies

    My sql path is
    Qt Code:
    1. c:/Mysql/mysql-noinstall-5.1.38-win32/mysql-5.1.38-win32/lib/opt
    To copy to clipboard, switch view to plain text mode 

    here i executed reimp libmysql.lib in Mingw at above path

    but it is showing

    Qt Code:
    1. sh: reimp: command not found
    To copy to clipboard, switch view to plain text mode 

    Please help me


    Thanks

    Yuvaraj R

Similar Threads

  1. How to use static mysql plugin
    By khikho in forum Qt Programming
    Replies: 7
    Last Post: 19th January 2009, 21:44
  2. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13
  3. Qt4 win opensource + mysql plugin
    By vr in forum Installation and Deployment
    Replies: 3
    Last Post: 25th May 2007, 09:01
  4. MySql plugin driver issues
    By stevey in forum Installation and Deployment
    Replies: 11
    Last Post: 20th September 2006, 13:45

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.