Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect to MySQL server #6

Open
kdridi opened this issue Oct 15, 2012 · 2 comments
Open

Can't connect to MySQL server #6

kdridi opened this issue Oct 15, 2012 · 2 comments

Comments

@kdridi
Copy link

kdridi commented Oct 15, 2012

Hello,

I'm a beginner in haskell and i have a problem using haskelldb.
I've developped this code : http://hpaste.org/76300
When i use ghci, it works like a charm. However, when i compile it using ghc, the program connects sometime to the mysql server and sometime not.
The program is quite simple so i'm wondering if you have any clue about the error.

Thank you !

Test: user error (SQL error: SqlError {seState = "", seNativeError = 2003, seErrorMsg = "Can't connect to MySQL server on '192.168.1.10' (4)"})

@kdridi
Copy link
Author

kdridi commented Oct 15, 2012

One more thing that may help

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2

cabal list --installed haskelldb

  • haskelldb
    Synopsis: A library of combinators for generating and executing SQL
    statements.
    Default available version: 2.2.1
    Installed versions: 2.2.1
    Homepage: https://github.com/m4dc4p/haskelldb
    License: BSD3
  • haskelldb-hdbc
    Synopsis: HaskellDB support for HDBC.
    Default available version: 2.2.1
    Installed versions: 2.2.1
    Homepage: https://github.com/m4dc4p/haskelldb
    License: BSD3
  • haskelldb-th
    Synopsis: Template Haskell utilities for HaskellDB.
    Default available version: 2.1.0
    Installed versions: 2.1.0
    Homepage: http://trac.haskell.org/haskelldb-th
    License: BSD3

cabal list --installed hdbc

  • HDBC
    Synopsis: Haskell Database Connectivity
    Default available version: 2.3.1.1
    Installed versions: 2.3.1.1
    Homepage: https://github.com/hdbc/hdbc
    License: BSD3
  • HDBC-mysql
    Synopsis: MySQL driver for HDBC
    Default available version: 0.6.6.1
    Installed versions: 0.6.6.1
    Homepage: http://github.com/bos/hdbc-mysql
    License: LGPL
  • haskelldb-hdbc
    Synopsis: HaskellDB support for HDBC.
    Default available version: 2.2.1
    Installed versions: 2.2.1
    Homepage: https://github.com/m4dc4p/haskelldb
    License: BSD3

@m4dc4p
Copy link
Owner

m4dc4p commented Oct 15, 2012

Try connecting by just using HDBC first. It may not be a HaskellDB issue at all.

Finally, GHCi and GHC use different rules to find libraries. You'll need to do some research to determine what's going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants