The HDBC-mysql package

[Tags: lgpl, library]

This package provides a MySQL driver for HDBC, implemented via bindings to the C mysqlclient library.

[Skip to ReadMe]


Versions0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.6.1, 0.6.2, 0.6.3,,,,,,
Change logChangeLog
Dependenciesbase (>=2 && <5), bytestring, HDBC (>=2.1.0), time, utf8-string [details]
Copyright2009-2010 Chris Waterson, 2011 MailRank
AuthorChris Waterson
MaintainerBryan O'Sullivan <>
Home page
Bug tracker
Source repositoryhead: git clone
head: hg clone
UploadedThu Aug 30 03:40:09 UTC 2012 by BryanOSullivan
Downloads4125 total (162 in last 30 days)
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]




Maintainers' corner

For package maintainers and hackage trustees

Readme for HDBC-mysql-


This is a "native" HDBC driver for MySQL that makes use of libmysqlclient to communicate with a MySQL server. By way of synopsis:

import Control.Monad import Database.HDBC import Database.HDBC.MySQL main = do conn <- connectMySQL defaultMySQLConnectInfo { mysqlHost = "", mysqlUser = "scott", mysqlPassword = "tiger" }

        rows <- quickQuery' conn "SELECT 1 + 1" []
        forM_ rows $ \row -> putStrLn $ show row

At the moment, please consider this to be "alpha" software. As far as I can tell, it works. There are some limitations that you should be aware of.



There's a little test program that runs a query and spews out the results. To compile it,

ghc -idist/build -L/opt/local/lib/mysql5/mysql -lmysqlclient --make Test

I'm still trying to get the Makefile right so that it can build the test sources: it's not there yet. Here's how I've been doing it, for now:

cd testsrc ghc --make -package HUnit -package HDBC -Wall -i../dist/build -i.. -L/opt/local/lib/mysql5/mysql -lmysqlclient -o runtests runtests.hs

One issue is that I want the location of the MySQL library to come from the configuration data, rather than be hard-coded.