Results 1 to 6 of 6

Thread: MySQL question using QT

  1. #1
    Join Date
    Feb 2009
    Posts
    189
    Thanks
    2

    Smile MySQL question using QT

    It’s slightly off-the-topic question I apologize for that. I am facing problem in connecting to mysql server from remote client. I am using this connection in my QT application. But even if I try to connect from outside QT I am failing.

    Pls check this snippet

    //in the /etc/my.cnf file I have added this line which is in the server where mysql is installed. @172.16.246.129
    bind-address = 10.149.20.120

    //then restarting mysql like this
    /etc/init.d/mysql restart

    //then trying to connect from 10.149.20.120 like this
    mysql –u root –h 172.16.246.129 –p
    //entering the password and it gives error as below

    ERROR 1130 (00000): Host ‘172.16.246.1’ is not allowed to connect to this MySQL server


    Can anyone help what’s going wrong in this ? Any help would be highly appreciated. Thanks Sujan

  2. #2
    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: MySQL question using QT

    Did you grant the user appropriate access rights for the database?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2009
    Posts
    189
    Thanks
    2

    Default Re: MySQL question using QT

    Yes I forgot to mention that.

    //I log in to mysql server as root and exceuted these commands

    mysql –u root mysql

    mysql> use myql;
    mysql> GRANT ALL ON *.* to root@’10.149.20.120’ IDENTIFIED BY ‘password’;
    mysql> FLUSH PRIVILEGES;

  4. #4
    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: MySQL question using QT

    Make sure you're not going through any NAT since you're using a private address as origin and the destination is in different subnet.

    You are going through NAT and your IP address gets changed.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2009
    Posts
    189
    Thanks
    2

    Default Re: MySQL question using QT

    DO I NEED to have mysql installed in the client machine ????.

  6. #6
    Join Date
    Oct 2011
    Location
    Toronto Canada
    Posts
    97
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: MySQL question using QT

    No MySQL does not need to be on the client I work with MySQL daily always remote servers I use qsqldatabase. Did you set this MySQL sever up ? Cause there may be an allow or deny configuration set on the server itself.

Similar Threads

  1. Replies: 0
    Last Post: 15th October 2011, 14:25
  2. I need MySQL driver for Qt 4.6, WindowsXP(32), MySQL 5.1
    By User_3 in forum Installation and Deployment
    Replies: 7
    Last Post: 15th October 2010, 15:19
  3. A different MySql Question (windows performance)
    By LWakeland in forum Qt Programming
    Replies: 0
    Last Post: 6th October 2009, 01:45
  4. Mysql query question
    By twells55555 in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2007, 23:41
  5. MYSQL 5 Table qt model as small Mysql admin
    By patrik08 in forum Qt-based Software
    Replies: 0
    Last Post: 1st May 2007, 09:43

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.