Results 1 to 6 of 6

Thread: [QMYSQL] connection problem

  1. #1
    Join Date
    Jun 2007
    Location
    Wrocław, Poland
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [QMYSQL] connection problem

    Hi all!
    I'm using QT 4.3.0 and MySQL Server 4.1. I'm trying to build the MySQL plugin using "Building the QMYSQL plugin on Windows using MinGW" tutorial:

    http://wiki.qtcentre.org/index.php?t...ws_using_mingw

    everything goes fine until step 5: "Run make - this should build the qsqlmysql.dll and libqsqlmysql.a files in the %QTDIR%/plugins/sqldrivers directory." Indeed, running make creates in the %QTDIR%/plugins/sqldrivers some files, but their names are "qsqlmysql4.dll" and "libqsqlmysql4.a". But I guess it's not a big problem, so I copy the libmysql.dll file from the MySQL installation's bin directory to a directory %QTDIR%/bin, and run
    the sqlbrowser demo. I can see QMYSQL in the combobox, so i fill blank spaces (database name, username, etc.) to connect - unfortunately i get the message "Can't connect to MySQL server on 'my.host.name' (10061) QMYSQL: Unable to connect". Could anyone help me with that? I think the problem might be in the libqsqlmysql4.a and libqsqlmysqld4.a files - when I open
    HKEY_CURRENT_USER\Software\Trolltech\OrganizationD efaults and look into "Qt Plugin Cache 4.3.false" there are two registry keys for libqsqlmysql4.a and libqsqlmysqld4.a files, where values are:
    Qt Code:
    1. 0
    2. 1
    3. unknown
    4. 2007-06-22T20:19:06
    To copy to clipboard, switch view to plain text mode 

    instead of:
    Qt Code:
    1. 40300
    2. 0
    3. Windows mingw release full-config
    4. 2007-06-19T23:38:29
    To copy to clipboard, switch view to plain text mode 
    for other keys (qsqlmysql4.dll and qsqlmysqld4.dll)...any clue? When I install MySQL 5 i don't even see QMYSQL in the combobox...

    On the other hand, when I try to connect with mysql at localhost everything works fine (I use 'localhost' as hostname, 'mysql' as database name, 'root' as username and 'password' as password) So i guess there is no problem with QMYSQL plugin. The problem shows when I try to connect with database on another server. I've no idea why Has anyone encountered similiar problems? I would appreciate any help!

  2. #2
    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: [QMYSQL] connection problem

    Quote Originally Posted by chaos_theory View Post
    On the other hand, when I try to connect with mysql at localhost everything works fine (I use 'localhost' as hostname, 'mysql' as database name, 'root' as username and 'password' as password) So i guess there is no problem with QMYSQL plugin. The problem shows when I try to connect with database on another server.
    Did you remember to grant your user right to connect from a remote host?

    http://dev.mysql.com/doc/refman/4.1/...ing-users.html

  3. The following user says thank you to jacek for this useful post:

    chaos_theory (28th June 2007)

  4. #3
    Join Date
    Jun 2007
    Location
    Wrocław, Poland
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [QMYSQL] connection problem

    Quote Originally Posted by jacek View Post
    Did you remember to grant your user right to connect from a remote host?

    http://dev.mysql.com/doc/refman/4.1/...ing-users.html
    Thanks a lot, Jacek!
    I guess that was a problem - in the COLUMN_PRIVILEGES table, the GRANTEE option is set to 'user'@'localhost', which means I can access to MySQL database only from this host (am I right?).
    Unfortunately, the IS_GRANTABLE option is set to NO, so I'll have to talk to administrator...or connect to host first, and then connect to MySQL database. Thanks again for solving my problem!

  5. #4
    Join Date
    Jun 2007
    Location
    Wrocław, Poland
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [QMYSQL] connection problem


  6. #5
    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: [QMYSQL] connection problem

    Quote Originally Posted by chaos_theory View Post
    Next time, please, don't post the same question in more than one thread.
    Last edited by jacek; 2nd July 2007 at 11:50. Reason: typo

  7. #6
    Join Date
    Jun 2007
    Location
    Wrocław, Poland
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [QMYSQL] connection problem

    Ok, sorry for that

Similar Threads

  1. Mysterious Qt4.2.0 Mysql 5.0.41 connection problem
    By locus in forum Qt Programming
    Replies: 5
    Last Post: 4th July 2007, 18:59
  2. Signal-slots connection problem.
    By impeteperry in forum Qt Tools
    Replies: 26
    Last Post: 23rd January 2007, 15:33
  3. connection problem
    By mhoover in forum Qt Programming
    Replies: 1
    Last Post: 7th July 2006, 23:14
  4. Replies: 16
    Last Post: 7th March 2006, 16:57

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.