how to connect mysql remote database from iphone

Discussion in 'iOS Programming' started by srinivas.be88, Sep 14, 2010.

  1. srinivas.be88 macrumors newbie

    Joined:
    Aug 10, 2010
    #1
    hi ,
    Hello, Can somebody please provide some example code to how I might connect a iPhone to a remote mysql database directly ( I know it's not the best way but is what is required for my app) ....

    i need to upadte a database and retrive information


    i am using cocos2D template to connect to the database
     
  2. adrian.oconnor macrumors 6502

    Joined:
    Jan 16, 2008
    Location:
    Nottingham, England
    #2
    Here's a blog post where someone has listed the steps to build libmysql for iPhone. It should be exactly what you need:

    http://blog.iosplace.com/?p=20
     
  3. srinivas.be88 thread starter macrumors newbie

    Joined:
    Aug 10, 2010
    #3
    thank you for reply... this link gave what i need
     
  4. Karl Kraft macrumors newbie

    Joined:
    Jul 9, 2010
    #4
  5. ulbador macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #5
    I don't know what you are planning on doing, but connecting remotely to a database is a horrible idea.

    First, you basically eliminate any security that is built into the database. The username and password will be sent across the network in the clear, not to mention stored in the app. If you want to do something like this, build a web service. Have you iPhone app connect to a web server running something like Java, PHP or ASP that provides an interface to your database.
     
  6. adrian.oconnor macrumors 6502

    Joined:
    Jan 16, 2008
    Location:
    Nottingham, England
    #6
    For every tool there is a purpose. There are plenty of good reasons why OP might want to connect to MySQL directly. Maybe he's writing a MySQL management tool for iPhone. Maybe he doesn't want his product to require a web front end, for simplicity's sake. Maybe's it's a bespoke line-of-business app that will only get used in a particular way.

    He can secure connections with ssh or SSL, if that's a requirement.
     

Share This Page