Search code examples
c#.netmysqlvisual-studio-2010embedded-database

Is MySQL primarily web based? I want to copy when deploying .NET application


I have worked with Microsoft Access as the back-end of my applications in the past and Visual Studio offers me the choice of copying the database to the installation of the executable that I have created. However, I now want to move onto more complex databases and I figured MySQL was a good start because it's free and popular. I know there may be better options and right now I'm currently only in learning stages so I strictly want to stick with MySQL.

My problem is that I have my MySQL running on my localhost. I have connected to it, ran queries, etc. Now if I wanted to deploy this application to other computers while keeping the database (not web-based) how would I go about doing that? The reason I don't want to go web yet is because I just want to get an understanding without dealing with networking yet. I figured this would be the way to go.

Thank you.


Solution

  • MySQL is not primarily anything. It's a full database as is Oracle, SQLServer, Postgre, etc. that can be used for any application that you feel it applies to.

    In your case what you really want is SQLite for "embedded" database needs. The database is represented by a single file that can be opened and queried very similarly to MySQL.

    http://www.sqlite.org/

    To access the database from your C# code there are many libraries available to you. Here is one I used a while back as an example:

    http://www.devart.com/dotconnect/sqlite/features.html

    To play around with the data, as you would with MySQL Workbench, there are many front-ends. As an example there's a pretty good firefox addon for this:

    https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/

    And don't worry, it's extremely easy to use and most of the query syntax will apply to MySQL as well!