Running MySQL wrapper on Win7 64-Bit

 

I was using the libmysql.dll to read and write to a mysql db. However when fetching the rows sometimes returns empty rows althought the data is set correctly in the db.

We (other programmer and me) tested it through and throught with the same data in all rows but this method seems to be instable for no detectable reason - we where not able to find any patterns!

This is why we try to use the MySQL wrapper from Russel: https://www.mql5.com/en/code/8623

1. mysql_wrapper.dll and a working libmysql.dll are in experts\libraries

2. DLL imports are allowed

3. MySQL Database runs and works fine

When starting the script we always get error: "cannot load library 'mysql_wrapper.dll' (error 193)" and MT4 stops the Script.

As it is a windows api32 error we looked it up:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx

it says:

ERROR_BAD_EXE_FORMAT 193 (0xC1) %1 is not a valid Win32 application.

For us it seems that it can import the dll but then there comes up some error ...

How could this be solved to make the MySQL wrapper run on Win7?

 
mql4 is a 32 bit application so requires a 32 bit dll. Check your compile/link settings. Compiler's/linkers default to 64 bit on 64 bit OS.
 

thx for your reply,

our libmysql.dll is the 32-bit version from the official mysql site. The mysql_v2.0.4.mqh is, besides of the db access data, unchanged! The libmysql.dll used by its own in a mql4 script works as well ... so on our opinion there cant be a 32/64bit problem ...

 
Do we have to recompile the mysql_wrapper.dll for windows 7/.net in visual studio?
 
We recompiled it and it still gives us error 193 although we can use it in a c++ application and it works fine! Any ideas? I think it would be worth getting this to work for win7 as it would be a stable way to use mysql dbs in mql!
 

OK, we have ported this thing to win7 know, was a pain in the ass, but now works great! Could not upload it to the code base though ... if somebody is interested, write me a pm ... i would like to share it!

 
Did you mistakenly install in \program files* on Vista/Win7?
 

Hi everybody,

does anyone have a running version of dll to run MySQL wrapper on Win 7 64-Bit ?

I have contacted Haemse by private message some days ago but I think he is currently not reading the forum.

I would really appreciate any help from you !!

Kind regards, deutchman.

PS: i have checked the forum db, I still haven't found better thread than this one.

 

Hi,

Nobody here uses SQL and can help on Win 7 ??

I am rather surprised to not find any infos about running SQL in combination with Win 7...

Thank you in advance !

 

deutchman,

I found someone who solved this. Please send a pm and I will send.

Kind regards,

deutchman:

Hi,

Nobody here uses SQL and can help on Win 7 ??

I am rather surprised to not find any infos about running SQL in combination with Win 7...

Thank you in advance !

 
haemse:

I was using the libmysql.dll to read and write to a mysql db. However when fetching the rows sometimes returns empty rows althought the data is set correctly in the db.

We (other programmer and me) tested it through and throught with the same data in all rows but this method seems to be instable for no detectable reason - we where not able to find any patterns!

This is why we try to use the MySQL wrapper from Russel: https://www.mql5.com/en/code/8623

1. mysql_wrapper.dll and a working libmysql.dll are in experts\libraries

2. DLL imports are allowed

3. MySQL Database runs and works fine

When starting the script we always get error: "cannot load library 'mysql_wrapper.dll' (error 193)" and MT4 stops the Script.

As it is a windows api32 error we looked it up:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx

it says:

ERROR_BAD_EXE_FORMAT 193 (0xC1) %1 is not a valid Win32 application.

For us it seems that it can import the dll but then there comes up some error ...

How could this be solved to make the MySQL wrapper run on Win7?

Hi haemse,

Have you tried to put the "mysql_wrapper.dll" to "C:\Windows\system32\ " instead of "experts\libraries" ?

I think Russel told us to put it in "C:\Windows\system32\ " ...

Thanks