Results 1 to 16 of 16

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: objective-c with remote MySQL server

  1. #1
    Default objective-c with remote MySQL server
    Hi,
    anyone has any idea how i can use objective-c to connect to a remote mysql server?
    it can be either direct or indirect through a script...
    i want to make an app that sync with a remote mysql database... but i dunno where to start looking

  2. #2
    Quote Originally Posted by peeInMyPantz View Post
    Hi,
    anyone has any idea how i can use objective-c to connect to a remote mysql server?
    it can be either direct or indirect through a script...
    i want to make an app that sync with a remote mysql database... but i dunno where to start looking
    Do the libraries that allow Notes to save to local SQL not allow remote? Not sure what they are, but you could probably browse framework headers on Erica Sadun's site and track it down.
    If not, surely there is some sort of SQL stuff available in C/C++/ObjC.

    If not, you might want to look into Java via JamVM, on Jay Freeman's repository. I believe it has an SQL library available for it.

  3. #3
    The iPhone's built-in SQL is sqlite, not MySQL.

    Sqlite is a local embedded SQL that doesn't use a separate engine process.

    You will need a MySQL client library conpiled for the iPhone to link against.
    Last edited by NetMage; 2008-01-27 at 05:29 PM. Reason: iPhone typo
    Starlight Computer Wizardry
    Pocket-sized Development
    Follow me on twitter: @NetMage

  4. #4
    Default hmmm
    Quote Originally Posted by NetMage View Post
    The iPhone's built-in SQL is sqlite, not MySQL.

    Sqlite is a local embedded SQL that doesn't use a separate engine process.

    You will need a MySQL client library conpiled for the iPhone to link against.
    Instead of it being a library wouldent it be called a framework?
    Because I have found a cocoa mysql framework but right now I can't get it to work when compiling to an iPhone app.
    Or am I completley mistaken?

    G

  5. #5
    The fourth time I have tried to post this *sigh* isn't the Internet wonderful...

    Binary (even universal binaries) for OS X are not compatible with the iPhone. You will need to get the source for the MySQL client library and compile it yourself.

    Unfortunately, MySQL doesn't appear to support a Cygwin port so that may make compiling with the toolchain difficult. Even more unfortunately, the source for the client is not cleanly separated from the server, but if you are using the SDK, compiling for OS X would probably give you a good starting point.

    Here is an article that may help:
    MySQL on Mac OS X
    Starlight Computer Wizardry
    Pocket-sized Development
    Follow me on twitter: @NetMage

  6. #6
    Can you just make a remote sqllite database to query?

  7. #7
    Default hmmm
    Quote Originally Posted by NetMage View Post
    The fourth time I have tried to post this *sigh* isn't the Internet wonderful...

    Binary (even universal binaries) for OS X are not compatible with the iPhone. You will need to get the source for the MySQL client library and compile it yourself.

    Unfortunately, MySQL doesn't appear to support a Cygwin port so that may make compiling with the toolchain difficult. Even more unfortunately, the source for the client is not cleanly separated from the server, but if you are using the SDK, compiling for OS X would probably give you a good starting point.

    Here is an article that may help:
    MySQL on Mac OS X

    I have found source for a Cocoa MySQL framework/library. It compiles correctly, but when the iPhone simulator tries to run it, it completely crashes and needs to send a report. I have already sent an email to support, but they don't exists.

    So what about this as a starting point, if you download it look for a framework called MCPKit_bundled.framework. That is the one you need.

    SourceForge.net: Downloading ...

  8. #8
    Default iPhone client for remote MySQL servers on appstore now
    I was also needing an iPhone/Touch client to access my inventory database built on MySQL. I found Flipper on the appStore. You can connect to multiple databases, write multi-line queries and a bunch of other stuff. It's well worth the 99 cents.

  9. #9
    Default libmysqlclient.a, file is not of required architecture
    Quote Originally Posted by gregcaulder View Post
    I have found source for a Cocoa MySQL framework/library. It compiles correctly, but when the iPhone simulator tries to run it, it completely crashes and needs to send a report. I have already sent an email to support, but they don't exists.

    So what about this as a starting point, if you download it look for a framework called MCPKit_bundled.framework. That is the one you need.

    SourceForge.net: Downloading ...
    Hi,
    me too I am trying to implement mysql in my app for iPhone 2.2.
    I have downloaded the mysql source from MySQL 5.1 Source Downloads
    then I have properly compiled it with terminal, but when I get the resulting static lib libmysqlclient.a and link it to my XCode project-release-iphone, I get an error when compiling:
    ld warning: in Libs/iPhone/libmysqlclient.a, file is not of required architecture.
    I have compiled the sources with these 3 commands in terminal

    ./configure --prefix=/usr/local --enable-cross-compile --host=arm-apple-darwin9.6.0 --target=arm-apple-darwin9.6.0 --with-machine-type=arm

    make

    sudo make install

    Then I took the library libmysqlclient. from /usr/local/mysql/lib
    My big question is: how to set the ./configure text line in Terminal in order to properly compile the mysql source for the iPhone 2.2?
    Any pointer would be greatly welcome. Thank you.

  10. #10

  11. #11
    yes, but the thing is that objective-c code has to call the official mysql-client library at some point and that library is now GPL (no longer LGPL) --so you can't include it in an app that is distributed commercially through Apple AppStore (GPL violation is why VideoLAN Client was removed from the AppStore, for example) and even if Apple accepts it, Oracle can come after you legally. (Oracle is suing Google right now!) The mysql-client can only be used on computers you own or in apps you give away in source-code format (unless you buy a license from Oracle). The best alternative is going to be to use ODBC (google for "ipad odbc sdk") which saves weeks of custom code.

  12. #12
    Quote Originally Posted by bigdb View Post
    yes, but the thing is that objective-c code has to call the official mysql-client library at some point and that library is now GPL (no longer LGPL) --so you can't include it in an app that is distributed commercially through Apple AppStore (GPL violation is why VideoLAN Client was removed from the AppStore, for example) and even if Apple accepts it, Oracle can come after you legally. (Oracle is suing Google right now!) The mysql-client can only be used on computers you own or in apps you give away in source-code format (unless you buy a license from Oracle). The best alternative is going to be to use ODBC (google for "ipad odbc sdk") which saves weeks of custom code.
    Curious.
    Sounds like you might still be able to build and distribute something through Apple's AppStore, if:
    • licensed under a non-GPL but OSI-compliant Free license -
    • if you could find such a license that is compatible with AppStore (GPL evidently is not) -
    • if Apple allowed you to bundle the source in with the App itself.


    weaving through these myriad threads would be a neat challenge

  13. #13
    Sadly, MySQL doesn't want its client library under anything but paid or GPL (they stopped LGPL after MySQL 3.x), so for app-binaries you pretty much have to use ODBC or spend a long time writing custom code for every app or perhaps become locked-in to a proprietary cloud API where they can change the monthly cost.

  14. #14
    Quote Originally Posted by bigdb View Post
    Sadly, MySQL doesn't want its client library under anything but paid or GPL (they stopped LGPL after MySQL 3.x), so for app-binaries you pretty much have to use ODBC or spend a long time writing custom code for every app or perhaps become locked-in to a proprietary cloud API where they can change the monthly cost.
    Oops, I missed something in:
    MySQL :: FOSS License Exception
    Section 2a:

    Under the exception, you can build and ship a derived program under an OSI-approved-Non-GPL license,
    but Oracle requires you to adhere to the GPL "in all respects for the Program and all portions".

    e.g Dual-license, with GPL overruling anything else, and Oracle overruling GPL.
    e.g. useless

    Edit:

    So, anyone want to work on a MySQL 3.x fork?
    Last edited by raduga; 2011-10-20 at 10:17 PM.

  15. #15
    In that context "the Program" refers solely to the MySQL client libraries and not any "Independant Works" so it may be possible to find a FOSS license that is Apple compatible in the list.
    Starlight Computer Wizardry
    Pocket-sized Development
    Follow me on twitter: @NetMage

  16. #16
    Why dont you build a webservice on a remote server which pulls back data? Like you can pass it SQL and t returns the XML dataset back which you can then process on your iPhone or any other application? Thats how i work around not having the relevant datasources. That way you can open it up to virtually any database as the webservice does all the hard work and the iPhone just reads what its been sent. Just an idea

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •