Results 1 to 16 of 16

Thread: How could I connect to MYSQL server if that server do not allowed any remote access?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How could I connect to MYSQL server if that server do not allowed any remote acce

    Not necessarily.

    It will mostly depend on the skill set of the involved people. If there are skilled PHP developers as well as skilled C++ developers each side should not have any problems maintaining their part.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    stereoMatching (29th January 2014)

  3. #2
    Join Date
    Jan 2011
    Posts
    127
    Thanks
    42
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How could I connect to MYSQL server if that server do not allowed any remote acce

    Quote Originally Posted by anda_skoa View Post
    No, this is one option.

    Additional to the web service approach already mentioned there is also the option of splitting the Qt application in frontend (client) and backend (server).
    Or connecting through a VPN, an SSH tunnel, etc,

    Cheers,
    _
    After google(VPN or SSH), the connection could become more secure, but the port still need to be opened
    The admin worry that the server may suffer port attack if he open the port

    Back to the php and c++, how could I use php as backend?
    Create a QWebview, access the website, query the data by php, and show the data by Qt?

  4. #3
    Join Date
    Jul 2011
    Location
    Italy
    Posts
    24
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How could I connect to MYSQL server if that server do not allowed any remote acce

    Quote Originally Posted by stereoMatching View Post
    Create a QWebview, access the website, query the data by php, and show the data by Qt?
    No.
    Use QNetworkAccessManager to make the request to the server (GET or POST), read from QNetworkReply and parse the data returned (xml or json).

  5. The following user says thank you to sakya for this useful post:

    stereoMatching (29th January 2014)

  6. #4
    Join Date
    Jan 2011
    Posts
    127
    Thanks
    42
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How could I connect to MYSQL server if that server do not allowed any remote acce

    Quote Originally Posted by sakya View Post
    No.
    Use QNetworkAccessManager to make the request to the server (GET or POST), read from QNetworkReply and parse the data returned (xml or json).
    According to your suggestions, we could
    1 : use php to query, update db and generate xml or json
    2 : use QNetworkAccessManager to post the request, ask the server generate json
    and insert the data into the model
    3 : update the data by posting request by QNetworkAccessManager

    Maybe not so difficult.

  7. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How could I connect to MYSQL server if that server do not allowed any remote acce

    Quote Originally Posted by stereoMatching View Post
    After google(VPN or SSH), the connection could become more secure, but the port still need to be opened
    Open as in make MySQL listen for TCP connections or open as in open for outside connections?

    Because the second is obviously not true, it would only allow internal connections in the VPN or SSH case.

    You will always need some way to connect into your network, either through HTTPS, VPN or SSH.
    The last two allow you to tunnel the database connection.

    A fourth alternative is to use a SSL connection directly between a server component and a client component.

    Cheers,
    _

  8. #6
    Join Date
    Jan 2011
    Posts
    127
    Thanks
    42
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How could I connect to MYSQL server if that server do not allowed any remote acce

    Quote Originally Posted by anda_skoa View Post
    Open as in make MySQL listen for TCP connections or open as in open for outside connections?

    Because the second is obviously not true, it would only allow internal connections in the VPN or SSH case.

    You will always need some way to connect into your network, either through HTTPS, VPN or SSH.
    The last two allow you to tunnel the database connection.

    A fourth alternative is to use a SSL connection directly between a server component and a client component.

    Cheers,
    _
    Don't know what is the meaning of "open as in open for outside connections".
    But I find this solution--http://stackoverflow.com/questions/1...-remote-access

    Looks like there are more than one way to allow the computer of the local network to access the local server without open a port
    1 : open as in open for outside connections(VPN or SSH)
    2 : ssl
    3 : use php to query and update db, Qt do another job

Similar Threads

  1. Connect to the MYSQL server successful but can't see any data
    By stereoMatching in forum Qt Programming
    Replies: 1
    Last Post: 9th January 2014, 04:06
  2. Replies: 2
    Last Post: 16th April 2012, 13:42
  3. Replies: 3
    Last Post: 8th March 2011, 07:57
  4. QFtp: downloading a whole folder from a remote server.
    By balazsbela in forum Qt Programming
    Replies: 5
    Last Post: 5th August 2007, 09:34
  5. Acces to a remote mysql server
    By Alienxs in forum Qt Programming
    Replies: 2
    Last Post: 19th August 2006, 03:10

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.