Results 1 to 7 of 7

Thread: using Mysql: Ca't create TCP/IP socket

  1. #1
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation using Mysql: Ca't create TCP/IP socket

    Trying to create connection, but always see this message
    Ca't create TCP/IP socket (10093): QMYSQL unable to connect
    Os: WinXP, Qt 4.1, compiler VC.net
    set all availible parameters in sql example file:

    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
    2. db.setHostName("localhost");
    3. db.setDatabaseName("qt");
    4. db.setUserName("root");
    5. db.setPassword("xxw22332");
    6. db.setPort(3306);
    7. if (!db.open()) {
    8. QMessageBox::critical(0, qApp->tr("Cannot open database"),
    9. db.lastError().text(), QMessageBox::Cancel,
    10. QMessageBox::NoButton);
    11. return false;
    12. }
    To copy to clipboard, switch view to plain text mode 
    connection parameters right.
    Try to build mysql plugin from source...
    But error everytime.
    Succes is 5% of talent and 95% of work!

  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: using Mysql: Ca't create TCP/IP socket

    Did you add "QT += sql" to your .pro file? Can you connect to MySQL server using the MySQL console?

  3. #3
    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: using Mysql: Ca't create TCP/IP socket

    db.setPassword("xxw22332");
    Never post your passwords anywhere (even if they are fake). Never!

    Do you have a firewall running?

  4. #4
    Join Date
    Feb 2006
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using Mysql: Ca't create TCP/IP socket

    copy libmysql.dll to /system32.
    If dont work run /demos/sqlbrowser, if dont work too seache you problem in QMYSQL plugin.

  5. #5
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using Mysql: Ca't create TCP/IP socket

    Quote Originally Posted by crocus
    copy libmysql.dll to /system32.
    If dont work run /demos/sqlbrowser, if dont work too seache you problem in QMYSQL plugin.
    Sqlbrowser can't connect. Write this erro too.
    I think too that problem in QMYSQL. and try to build qmysql.dll from source of mysql server on my machine. I remember for testing my localhost apache server + php i set mysql to use OLD_PASSWORD mode. But all mysql clients connect succesfuly to localhost server.
    Last edited by blackliteon; 9th February 2006 at 07:30.
    Succes is 5% of talent and 95% of work!

  6. #6
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using Mysql: Ca't create TCP/IP socket

    Quote Originally Posted by wysota
    Never post your passwords anywhere (even if they are fake). Never!

    Do you have a firewall running?
    This is a fake...
    But if any ideas what can i Do by hand ?
    Succes is 5% of talent and 95% of work!

  7. #7
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: using Mysql: Ca't create TCP/IP socket

    Hi all!
    I just solve my problem with Qt-mysql and now i'll say about it.
    So.
    I don't know _why_, but when i used mytest.exe from mysql direcory it says me too:
    can't connect throw port 3306.
    Ok, I'm start
    netstat -a
    and saw that 3306 port is listening.
    And my ems mysql manager connect succesfully!!!!
    I try restart service mysql, start it manually... nothing.
    So.. decide reinstall mysql
    Before my installation path was /program files/mysql/...
    now I install it to c:/mysql
    allow anonymous to connect,
    restart windows....
    start mytest.exe -- It works!!!!
    try to run qt4.1 sqltable example.. nothing! TCP/IP socket error!!!
    Ok, little time ago i rebuild qmysql plugin, and nothing happense, but i want to try one more times..
    recompile plugin,,, and
    ba-baam!
    It works!
    So, what happends.... Really I don't know. Maybe because I set OLD_PASSWORD for connecting to server before (i used apache+php4 on localhost)
    Thanks to all who try help me.

    PS
    We dont need to copy libmysql.dll to windows or system32
    Succes is 5% of talent and 95% of work!

Similar Threads

  1. Cannot create MySQL stored procedure / views from Qt
    By pshah.mumbai in forum Qt Programming
    Replies: 8
    Last Post: 8th October 2008, 16:22
  2. QSqlDatabase default MySQL unix socket path
    By daggilli in forum Qt Programming
    Replies: 0
    Last Post: 21st September 2008, 19:55

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.