Results 1 to 2 of 2

Thread: MySQL and shared-memory connection

  1. #1
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default MySQL and shared-memory connection

    Hi,

    has anybody successfully got connected to a mysql server using a shared mem connection? I can't get it work. Connecting via tcp works fine but if I set the sql.ini to "skip-networking" and set the parameters for a shared mem connection I get the error:
    "Can't connect to MySQL server on 'localhost' (10061) QMYSQL: Unable to connect"

    My sql.ini settings:

    Qt Code:
    1. skip-networking
    2. shared-memory
    3. shared-memory-base-name=TestApp
    4. enable-named-pipe
    5. socket=mysql-TestApp.sock
    6. bind-address=127.0.0.1
    7. port=3333
    8. init-connect="SET NAMES UTF8"
    9. basedir="../"
    10. datadir="../Data/"
    11. default-character-set=UTF8
    12. collation_server=utf8_unicode_ci
    13. default-storage-engine=INNODB
    14. sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
    To copy to clipboard, switch view to plain text mode 

    Client code:
    Qt Code:
    1. QSqlDatabase::setConnectOptions("protocol=memory;shared-memory-base-name=TestApp;")
    To copy to clipboard, switch view to plain text mode 

    Database: MySQL v. 5.1.26 running as standalone
    Qt: 4.3.4

    Any ideas?

    Thanks,
    Patrik

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: MySQL and shared-memory connection

    Quote Originally Posted by patrikd View Post
    Hi,

    Client code:
    Qt Code:
    1. QSqlDatabase::setConnectOptions("protocol=memory;shared-memory-base-name=TestApp;")
    To copy to clipboard, switch view to plain text mode 
    Database: MySQL v. 5.1.26 running as standalone

    Thanks,
    Patrik
    QSqlDatabase::setConnectOptions on QMysql only this option you can set..

    CLIENT_COMPRESS
    CLIENT_FOUND_ROWS
    CLIENT_IGNORE_SPACE
    CLIENT_SSL
    CLIENT_ODBC
    CLIENT_NO_SCHEMA
    CLIENT_INTERACTIVE
    UNIX_SOCKET

    read my answer on German Forum...
    http://www.qtforum.de/forum/viewtopic.php?p=36454#36454

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.