Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Samppaa

macrumors regular
Original poster
Mar 26, 2010
168
23
I would need to use mysql with cocoa for my app and found only the outdated version of some library, what would you guys recommend? Is there any new ones possibly because I read that OS X doesn't support mysql already.
 
A few notes:

- MacOS X client does not have MySQL client or server installed by default, nor is it an option from the install disc. MacOS X Server has both. You can install both client and server code yourself, and they seem to be well supported.

- There have been a few Obj-C libraries out there, but none of them seems to get much beyond the beta stage before their developers give up. At least this is my impression.

- If you use the MySQL client libraries in your app then you MUST make your app GPL if you are going to distribute it. Or you can pay the MySQL group for a client license. Those are your only options.

- If your app is going to need to have a local database, and does not access a database across a network, then MySQL is most likely the wrong choice and either SQLite or CoreData. Those solutions do not require setting up a complicated server on client workstations. They also happen to have easier licensing requirements (ie: just about none).

- If you are looking for something really that complex, but have licensing issues with the GPL, then you should probably look at PostgreSQL. It is arguably better than SQL in almost any regards, and is BSD licensed.
 
A- If you use the MySQL client libraries in your app then you MUST make your app GPL if you are going to distribute it. Or you can pay the MySQL group for a client license. Those are your only options.

Or you make a non-GUI executable that is linked to the MySQL client libraries and make that GPL. Then your proprietary, non-GPL, GUI app can start an instance of that executable and talk to it via distributed objects.
 
Is there any license friendly alternatives for mysql? With mac connector please, as I am making mac program which uses it. I just need database where my client programs can get info from..
 
SQLite. It's not opensource, it\s public domain, so you don't need to pay a license fee, but, there's always a but somewhere; this does not apply to Germany which has bonkers rules. Germany does not believe in public domain, so you need to buy a license for SQLite from Dr Richard Hipp, about $10,000. Don't need this license anywhere else.

Or you could do the simple thing that robbieDuncan posted and split your program into two parts. Create a shared API between the two that does not use the database, and have the non-gui portion of the application 'wrap' the MySQL C connector. You will only need to wrap a few simple functions. One to create/get a connection. Ones to execute statements, depending on whether they are updates/deletes/inserts or selects. Some simple ones to Start a transaction, and another to commit a transaction. Those simple ones shouldn't take more than a few days of work to get right, and the C connector will come with plenty of examples.

Hope that helps.
 
Is there any license friendly alternatives for mysql? With mac connector please, as I am making mac program which uses it. I just need database where my client programs can get info from..

PostgreSQL. It is BSD licensed so you can include any part of it you like in commercial applications, all you need to do is include a copyright notice and a disclaimer (read the license).

Edit: Sorry didn't see your second post.

Yes it is worth trying out. It is arguably a better database system than MySQL with better SQL standards support and simpler approach (no need for multiple storage engines for instance). Plus the documentation is about the best you will find in any computer software product.
 
Can I use it in cocoa I mean postgre sql and put server on my windows computer.
 
Can I use it in cocoa I mean postgre sql and put server on my windows computer.

Yes.

Take a look at PostgreSQL for Mac. They have a Framework that's an Objective-C bridge to Postgres called PGSQLKit. It's BSD licensed.

An alternative for working with PostgreSQL and Cocoa is the BaseTen framework. It's not free for commercial apps, but the license is only $200/developer. It allows you to access Postgres much like Core Data using a model builder. It's really neat and worth running through the tutorial.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.