[Haskell-cafe] Use MySQL from Haskell

Maciej Podgurski maciej.podgurski at googlemail.com
Thu Jun 18 17:26:02 EDT 2009


Hello,

I'm trying to use MySQL from Haskell but it seems impossible for me to 
install one of the MySQL packages on my Windows XP machine.

First I tired to install hsql-mysql-1.7.1 on GHC 6.10.3 but installing 
haskelldb-hsql failed with a hidden package error. So I added the 
old-time package to the cabal file but there still was a compile error 
(something due to the change from Exception to Exception e => e).

So I switched to GHC 6.8.3 and tried it again. Now it says:

Configuring hsql-mysql-1.7.1...
Warning: 'extra-lib-dirs: /usr/lib/mysql' directory does not exist.
Warning: 'include-dirs: /usr/include/mysql' directory does not exist.
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package process-1.0.0.1 requires filepath-1.1.0.0
package directory-1.0.0.1 requires filepath-1.1.0.0
package Cabal-1.6.0.3 requires filepath-1.1.0.2
Setup: Missing dependency on a foreign library:
* Missing C library: mysqlclient
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.

There's no Haskell package mysqlclient and I don't know how to install a 
C library in Haskell. So I switched to HDBC-2.1.1 and got the next 
compile error:

Building convertible-1.0.5...

Data/Convertible/Instances/Num.hs:671:0:
     warning: no newline at end of file
[...]
[5 of 8] Compiling Data.Convertible.Instances.C ( 
Data/Convertible/Instances/C.hs, dist\build/Data/C
onvertible/Instances/C.o )
[6 of 8] Compiling Data.Convertible.Instances.Time ( 
Data/Convertible/Instances/Time.hs, dist\build/
Data/Convertible/Instances/Time.o )

Data/Convertible/Instances/Time.hs:64:0:
    Duplicate instance declarations:
      instance Typeable NominalDiffTime
        -- Defined at Data/Convertible/Instances/Time.hs:(64,0)-(65,42)
      instance Typeable NominalDiffTime
        -- Defined in time-1.1.3:Data.Time.Clock.UTC

Data/Convertible/Instances/Time.hs:67:0:
    Duplicate instance declarations:
      instance Typeable UTCTime
        -- Defined at Data/Convertible/Instances/Time.hs:(67,0)-(68,34)
      instance Typeable UTCTime
        -- Defined in time-1.1.3:Data.Time.Clock.UTC

So please help me, what GHC/package configuration will I need to use 
MySQL from my Haskell programs on Windows? I really like Haskell but all 
those "broken" packages are really discouraging. :(


Best wishes,
Maciej


More information about the Haskell-Cafe mailing list