Question

I am getting started doing ASP.NET on my Mac using Mono, and I'm wondering which databases people have used in this setup. I'd be looking for something that is easy to set up, as this is just for fun and for continued learning of ASP.NET.

Was it helpful?

Solution

For your purposes, the SQLite version that comes with Mono (see here) seems perfect, no much how wonderful PostgreSQL (or, I guess, even MySQL;-) might be;-).

SQLite is everywhere (in .NET, in iPhones, comes with Mono, comes with Python, it's in Android, etc, etc), so getting familiar with it can hardly hurt anyway!-)

OTHER TIPS

You could use MySQL - it's well documented and has .Net drivers. See http://www.mono-project.com/Database_Access for a comprehensive list with driver info.

Postgresql via MacPorts. Npgsql as the .Net driver.

Whoa... SQLite isn't installed with Mono, I don't believe; just the connector is. From the same URL the accepted answer uses to say it's there already...

Prerequisites

If you do not have SQLite, download it. There are binaries for Windows and Linux. You can put the .dll or .so along side your application binaries, or in a system-wide library path.

If you want a database that works on OS X (and elsewhere) without change or prereqs other than a recompile, C#-SQLite, an unofficial, line-by-line port of SQLite to C#, might be worth a look. There are issues with compilation (one example here from May of last year), but with some research it apparently does okay (initially it had some P/Invokes that prevented compilation on OS X (and also Silverlight) which have been removed).

Better example of compilation problems as well as some reason for optimism here:

What steps will reproduce the problem?

  1. Compile database and SqliteClient and SqliteClientTests (works fine)
  2. Run Test No. 1 using command "mono SqliteClientTests.exe"
  3. Cry!

...

Comment 1 by project member market.n...@gmail.com, Sep 15, 2011 Have you contacted Miguel de Icaza at mono about this? I forget the details, but there were some compiler flags he set to get it working.

He told me last March that it was working. Maybe the 3.7.7.1 code set broke some things. Did you try the 3.7.5 or 3.7.6 versions?

So do your homework, but I think once you get a good build, this might be your answer.

I've used: Firebird, MySql, SQLite, Oracle and even Postgres long long ago.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top