Results 1 to 3 of 3

Thread: Problem connecting to remote database

  1. #1
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Problem connecting to remote database

    Hello
    I am using Qt to acces a local MySql Database and it works ok.
    The problem is when i change...
    Qt Code:
    1. db.setHostName("localhost");
    To copy to clipboard, switch view to plain text mode 

    ... by ...
    Qt Code:
    1. db.setHostName("192.168.1.100");
    To copy to clipboard, switch view to plain text mode 

    What else do i nead?

    Thanks

  2. #2
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem connecting to remote database

    This might be the reason: http://www.cyberciti.biz/tips/how-do...se-server.html

    I will check it as soon as i can get my hands on the server
    Last edited by graciano; 15th April 2009 at 16:25.

  3. #3
    Join Date
    Sep 2008
    Location
    Portugal
    Posts
    171
    Thanks
    57
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem connecting to remote database

    I changed in /etc/mysql/my.cnf ...
    ..this line ...
    Qt Code:
    1. bind-address = 127.0.0.1
    To copy to clipboard, switch view to plain text mode 
    ...by this line ...
    Qt Code:
    1. bind-address = 192.168.1.100
    To copy to clipboard, switch view to plain text mode 
    ... and now...
    Qt Code:
    1. db.setHostName("192.168.1.100");
    To copy to clipboard, switch view to plain text mode 
    ... connects as normally.

Similar Threads

  1. Multiple database connections
    By cyberboy in forum Qt Programming
    Replies: 3
    Last Post: 30th March 2008, 16:56
  2. Connecting to my database
    By miguel_mark in forum Qt Programming
    Replies: 6
    Last Post: 22nd October 2007, 09:50
  3. Database and QSqlRelationalTableModel problem
    By MarkoSan in forum Qt Programming
    Replies: 4
    Last Post: 22nd October 2007, 09:21
  4. problem in doing database program
    By wei243 in forum Qt Programming
    Replies: 0
    Last Post: 4th April 2007, 12:01
  5. Oracle Database Problem
    By magikalpnoi in forum Qt Programming
    Replies: 3
    Last Post: 27th September 2006, 21:19

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.