# Connecting to Mysql with ODBC vs C library

**URL:** <https://forums.percona.com/t/connecting-to-mysql-with-odbc-vs-c-library/173>\
**Category:** Other MySQL® Questions\
**Created:** [January 16, 2007, 1:21am UTC](https://forums.percona.com/t/connecting-to-mysql-with-odbc-vs-c-library/173 "2007-01-16T01:21:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![geelwortel](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@geelwortel](https://forums.percona.com/u/geelwortel)\
**Post date:** [January 16, 2007, 1:21am UTC](https://forums.percona.com/t/connecting-to-mysql-with-odbc-vs-c-library/173/1 "2007-01-16T01:21:28Z")

</div>

Hi All

I read in the MySQL 5 study guide that if you connect to MySQL with the C library that this connection will be alot faster than connecting with the ODBC driver. How do I connect with the C library? If this is not posible what other way of connecting can I use that does not use the ODBC?

Thank you

Andrew

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [January 16, 2007, 3:50am UTC](https://forums.percona.com/t/connecting-to-mysql-with-odbc-vs-c-library/173/2 "2007-01-16T03:50:48Z")

</div>

This applies mainly to development.

If you’re developing application use normal interface to MySQL, not ODBC. If it is third party application and it supports ODBC and native MySQL driver, use last one.

---

<div class="post-metadata">

**Author:** ![geelwortel](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@geelwortel](https://forums.percona.com/u/geelwortel)\
**Post date:** [January 17, 2007, 2:28am UTC](https://forums.percona.com/t/connecting-to-mysql-with-odbc-vs-c-library/173/3 "2007-01-17T02:28:51Z")

</div>

Thanx for your reply Peter

I know this is more a development problem than a DBA function and I hope you can help me with this. My developer keeps on telling me that the C library connection is written specifically for .net connections and doesn’t work well with C++ connections(our app is written in C++). All the manuals and documentation says that the connection works very well with C++. Is this true? Where can I get documentation about this that will help more for a developer than a DBA?

Thanx again for your help.

Andrew

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [January 17, 2007, 8:05am UTC](https://forums.percona.com/t/connecting-to-mysql-with-odbc-vs-c-library/173/4 "2007-01-17T08:05:26Z")

</div>

For .NET you should use native MySQL .NET connector not wrapper via ODBC.

---

<div class="post-metadata">

**Author:** ![geelwortel](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@geelwortel](https://forums.percona.com/u/geelwortel)\
**Post date:** [January 17, 2007, 8:43am UTC](https://forums.percona.com/t/connecting-to-mysql-with-odbc-vs-c-library/173/5 "2007-01-17T08:43:59Z")

</div>

Our application is written in C++ and we are looking for a way to connect to MySQL that works beter/faster than the ODBC. ODBC gives alot of problems when we run big reports. What can we use?

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [January 17, 2007, 8:50am UTC](https://forums.percona.com/t/connecting-to-mysql-with-odbc-vs-c-library/173/6 "2007-01-17T08:50:13Z")

</div>

In this case you simply can use libmysql.

You developer is wrong. Connector .NET is completely different thing

---

<div class="post-metadata">

**Author:** ![ovidiub](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@ovidiub](https://forums.percona.com/u/ovidiub)\
**Post date:** [January 24, 2007, 7:41pm UTC](https://forums.percona.com/t/connecting-to-mysql-with-odbc-vs-c-library/173/7 "2007-01-24T19:41:25Z")

</div>

For C++ you could use: mysql++ (using MySQL C API)  
[URL][http://tangentsoft.net/mysql++/[/URL]](http://tangentsoft.net/mysql++/%5B/URL%5D)

Ovidiu
