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

hdbc-mysql on Windows #14

Open
yogeshsajanikar opened this issue Jul 1, 2014 · 7 comments
Open

hdbc-mysql on Windows #14

yogeshsajanikar opened this issue Jul 1, 2014 · 7 comments

Comments

@yogeshsajanikar
Copy link

Do provide a support for windows. I know that there has already a detailed discussion on it. SIGALRM and SIGVTALRM are not generated on Windows! How do we handle this in source.

@darthdeus
Copy link

+1

1 similar comment
@azhai
Copy link

azhai commented Mar 12, 2015

+1

@KroshkaRu
Copy link

I looked for how to install this package for Windows.
I'm not good at Haskell and find workaround
Do follow steps:

  • install "MYSQL Connector C"
  • download HDBC-mysql-0.6.6.1.tar.gz
  • unarchive it to the folder and open folder in command line
  • create or download file mysql_config.bat (you can find it in the perl installer but it is actually very simple and it is stub)
@echo off
rem simplified replacement for the original shell script
set ROOT=%~dp0

set XCFLAGS=-I%ROOT%..\include\mysql_5
set XLIBS=-L%ROOT%..\lib -lmysql
set XVERSION=5.5.11
set XPREFIX=%ROOT%..\

for %%p in (%*) do (
  if x%%p == x--cflags     echo %XCFLAGS%
  if x%%p == x--libs       echo %XLIBS%
  if x%%p == x--version    echo %XVERSION%
  if x%%p == x--prefix     echo %XPREFIX%
  • open to edit file setup.lhs
  • make follow changes
mysqlConfigProgram = (simpleProgram "mysql_config.bat") {
    programFindLocation = \verbosity searchpath -> do
            mysql_config  <- findProgramOnSearchPath verbosity searchpath "mysql_config.bat"
            mysql_config5 <- findProgramOnSearchPath verbosity searchpath "mysql_config5"
            return (mysql_config `mplus` mysql_config5)
    }
-- **comment these lines**
{- mysqlConfigProgram = (simpleProgram "mysql_config") {
    programFindLocation = \verbosity -> do
      mysql_config  <- findProgramOnPath "mysql_config"  verbosity
      mysql_config5 <- findProgramOnPath "mysql_config5" verbosity
      return (mysql_config `mplus` mysql_config5)
  }
-}
-- in function **mysqlBuildInfo**
  let includeDirs = ["C:\\Program Files\\MySQL\\MySQL Connector C 6.1\\include"]
  -- <- return . map (drop 2) . split ws =<< mysqlConfig ["--cflags"]
  let ldOptions  = ["-LC:\\Program Files\\MySQL\\MySQL Connector C 6.1\\lib -lmysql"]
  -- <- return . split ws =<< mysqlConfig ["--libs"]
  • The path "C:\Program Files\MySQL\MySQL Connector C 6.1\include" is path to mysql on my computer but you may have another one
  • download signal.h (posix header) and remove line with _#include <machine/trap.h>_you will need only DEFINITION
  • put this header in to the "C:\Program Files\MySQL\MySQL Connector C 6.1\include"
  • cabal install with follow command line

cabal install --extra-lib-dirs="C:\Program Files\MySQL\MySQL Connector C 6.1\lib" --extra-lib-dirs="C:\Program Files\MySQL\MySQL Connector C 6.1\lib\vs12" --extra-include-dir="C:\Program Files\MySQL\MySQL Connector C 6.1\include" --extra-include-dir="C:\Program Files\MySQL\MySQL Connector C 6.1\include\mysql" --extra-include-dir="C:\Program Files\MySQL\MySQL Connector C 6.1\include\mysql\psi"

@azhai
Copy link

azhai commented May 14, 2015

Great job!

@KroshkaRu
Copy link

I'm really sorry.

It is really compiled but does not work unfortunately. GHC looks for some library probably it is linux core and full installation of MiNG did not help. GCC compile this library as i write. Looks like GCC can't compile execution with LIBs internal and require DLL also.
So I can connect to mySQL throw ODBC-HDBC driver only. It really works good.

Sorry for confusiong again.

@yogeshsajanikar
Copy link
Author

Hello, I made some changes to make it work, however, the changes are older, and main repository is now many commits ahead.

Please look at. Be aware that these are not finished yet.
https://github.com/yogeshsajanikar/hdbc-mysql

@ryantm
Copy link
Owner

ryantm commented Aug 25, 2016

@yogeshsajanikar What's not finished?

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

5 participants