Author Topic: Pelles C and MySQL Quick Start Tutorial  (Read 8596 times)


  • Guest
Pelles C and MySQL Quick Start Tutorial
« on: December 15, 2009, 02:22:23 PM »
If you don't have a server you can use to test your setup, Download and install MySQL Server.  I used XAMPP for this because I also needed Apache.

Download the "MySQL Connector" I used "Connector/C 6.0".  At the time of this writing you need to create an account so that you can login and download files. I downloaded the file without the installer.

Once unziped or installed make sure you know where the MySQL lib and include directories are.

Open your project options dialog.  Under the compiler tab, enable Microsoft extensions. (also known as "setting the Ze flag")

Under the folders tab add the lib and includes folders for the MySQL Connector you just unzipped (or installed).

Under the linker tab add... libmysql.lib to the list of libs

Create a test program.  Make sure you include at least the following...
Code: [Select]
#include <windows.h>
#include <winsock.h>
#include <mysql.h>
...and compile the project.  I modified this program for my test.

Copy the libmysql.dll next to the newly created .exe (found in the libs directory of the MySQL Connector)

Run. (We hope)

I've tried this with the latest version of Pelles C and this Quick Start is still accurate.

Ronald Weidner

« Last Edit: January 16, 2012, 04:19:38 AM by rweidner »