[MariaDB Provider] Installation tutorial

9 Posts
4 Users
0 Likes
100 Views
AD
 AD
(@a-degrearcinfo-com)
Posts: 34
Trusted Member
Topic starter
 

https://mari adb.org/ MariaDB Server is one of the most popular open source relational databases. It’s made by the original developers of MySQL and guaranteed to stay open source. It is part of most cloud offerings and the default in most Linux distributions. Unfortunately, Maria DB like some open source projects does not offer a ready to use ADO.NET provider. It is therefore necessary to make some steps on your side before taking advantage of the community work. Officiel ADO.NET data provider support MariaDB is : MySqlConnector The advantage to use it, is the large compatibility with other data sources based on MySQL:

  • - MySQL Server
  • - MariaDB
  • - Percona Server
  • - Amazon Aurora
  • - Azure Database for MySQL
  • - Google Cloud SQL for MySQL
  • - ...

The problem with this open source project is that only the code is available, not the binaries. It is therefore necessary to build the code. Don't panic, for those who don't have these skills it is possible to use the binary attached to the tutorial. Once the binaries are obtained it is possible to install a third party provider with the tool : "ProviderInstaller.exe". To be detected by PcVue, each ADO.NET provider must be installed in the Global Assembly Cache (GAC) of the .NET framework and referenced in the machine.config file. The tool "ProviderInstaller.exe" is there to facilitate this task. -- How to install MySqlConnector ADO.NET Provider -- Optional: Build Binaries for .NET https://github.com/mysql-net/MySqlConnector/ and merge assemblies (.dll) from target 4.7.1 with a tool like ILMerge. 1. Download Attachment "ProviderInstaller - MySqlConnector.zip" 2. Extract "ProviderInstaller - MySqlConnector.zip" to "ProviderInstaller - MySqlConnector" 3. Open CMD prompt as Administrator 4. Change directory to be in "ProviderInstaller - MySqlConnector" directory Ex:

cd "C:Usersarnaud.degreDownloadProviderInstaller - MySqlConnector"

5. Run following command:

ProviderInstaller.exe /install

The installation is complete !! The provider is now visible in PcVue SQL Connection (Data source : Other providers). -- Connection string -- . Connection string without database:

server=127.0.0.1;user id=arde;password=MySecret

. Connection string with database:

server=127.0.0.1;user id=arde;password=MySecret;database=MyDatabase

-- Sql queries -- . Create a Database

CREATE DATABASE `MyDatabase`

. Create a table

CREATE TABLE `MyTable` (col1 INT)

. Insert a value

INSERT INTO `MyTable` (col1) VALUES (1)

. Display table content

SELECT * FROM `MyTable`         

Found more samples here

This topic was modified 2 years ago by LM
 
Posted : 07/12/2022 10:08 pm
AD
 AD
(@a-degrearcinfo-com)
Posts: 34
Trusted Member
Topic starter
 

Please note that for Maria DB there is an alternative to the ADO.NET provider which is the ODBC driver also compatible with UDC.

Please take the version MS Windows 32-bit.
https://mariadb.com/downloads/connectors/connectors-data-access/odbc-connector

 
Posted : 07/12/2022 10:46 pm
(@admin_doc72)
Posts: 493
Member Admin
 

Hi Arnaud

Could you tell me how to choose between ODBC driver and ADO.NET in such a case ? Which one should we use and why ?

 
Posted : 21/12/2022 12:04 am
n.kunzer
(@n-kunzerarcinfo-com)
Posts: 1236
Member Moderator
 

Good question!
Maybe because odbc is an old-techno it would be better to use ado.Net

 
Posted : 21/12/2022 4:40 pm
(@admin_doc72)
Posts: 493
Member Admin
 

Hi niko

That's why I think too but if it is really an old techno I ask me why is it still maintened...
Is ADO.Net more secure, faster than ODBC ?

 
Posted : 21/12/2022 5:05 pm
LM
 LM
(@l-micaudarcinfo-com)
Posts: 383
Member Admin
 

Important things to take into account:

For me it is not usable and standard new projects.

 
Posted : 21/12/2022 5:09 pm
n.kunzer
(@n-kunzerarcinfo-com)
Posts: 1236
Member Moderator
 

Take care, if I am not mistaken, Arnaud was talking about the odbc driver through UDC. Meaning, to be clear, the ODBC ADO.Net provider 🙂

I let Arnaud giving his opinion

 
Posted : 21/12/2022 5:12 pm
AD
 AD
(@a-degrearcinfo-com)
Posts: 34
Trusted Member
Topic starter
 

First ODBC is old but not obsolete.
Also some new projects propose exclusively an OBDC connector like HDInsight (Hadoop by Microsoft).
The main reason for this choice is that ODBC is cross-platform not ADO.NET.
> So don't underestimate ODBC which is written in C/C++ language and therefore powerful.

The good news for us is that UDC can communicate natively with ADO.NET, ODBC and OleDb technologies.
I've seen that there are also ODBC to JDBC Gateways but I've never tried it (if you are interested look at Easysoft ODBC-JDBC Bridge).

Now to answer your question Nicolas, I think that the ADO.NET provider is to be preferred especially on a Windows OS with PcVue.
But I had to show you the two solutions because they exist and in the open source world it is very comfortable to have a plan B.

Why I choose the ADO.NET provider first ?
By looking at the Github repository we can see that this project has 61 contributors (developpers) and the releases versions are regular. The provider is also promoted by the MariaDB community on the official website.
I didn't see any missing basic function.
> So for me this solution is to be preferred.

But if you look at ODBC side, the connector is always updated by the community and supported by 22 contributors.

I would be interested in your feedback !

 
Posted : 21/12/2022 8:39 pm
(@admin_doc72)
Posts: 493
Member Admin
 

Thanks a lot for your answer Arnaud
It's very clear and now I know what I have to answer if someone ask me the question between ODBC and ADO.Net.

Nico

 
Posted : 22/12/2022 12:27 am