Using MYSQL in MT5 EA

 

Hello Everyone,

I am working on an EA that will recieve its optimized settings from an online mysql database. However I seem to be having problems getting the libmysql.dll file to import correctly.

I have tried following an article online that was posted in May, but believe there must of been changes, since the sample code does not work.

If anyone has tried this, or can help me out with some basic code to get it instantiated, please help!

 

MT5 or MT4 Code?

unclepips:
Hello Everyone,

I am working on an EA that will receive its optimized settings from an online mysql database. However I seem to be having problems getting the libmysql.dll file to import correctly.

I have tried following an article online that was posted in May, but believe there must of been changes, since the sample code does not work.

If anyone has tried this, or can help me out with some basic code to get it instantiated, please help!

Hi Unclepips,

Your post mentions importing MySQL to MT5. Do you have a link to that article?

I am wondering if the sample code you were using is MT4 code and not MT5 code? They are very different.

Just a quick thought to try and help.

Robert

 

The link to the article is at mqlmagazine.com.

If you google "sql mql5" it is in the list.

(sorry I am a noob to this forum so it wont let me post hyper links yet)

And yes, this is MT5!

The portion of code that is failing on me at the moment is

mysql=mysql_init(0); line 46 in the article.

If anyone has any insight, it would be very helpful.

 
unclepips:
The link to the article is at mqlmagazine.com.

If you google "sql mql5" it is in the list.

(sorry I am a noob to this forum so it wont let me post hyper links yet)

And yes, this is MT5!

The portion of code that is failing on me at the moment is

mysql=mysql_init(0); line 46 in the article.

If anyone has any insight, it would be very helpful.

Hi Unclepips,

I checked the articles and looked at the code but I'm not running SQL so I can't really test it for you.

It looks like there are Print lines for error checking in the code.

Do the Print error lines help you...or can you add more Print or Comment lines to help track down the errors?

Also thanks for the link to the MT5 magazine....very good stuff!

I hope you find some help to solve your SQL challenge.

Good Luck and Take care,

Robert

 

MySQL vs HTTP

I know this might not be what people are looking for, but I started working with MySQL a while back and found that it was unstable and unreliable enough.

However, I found a work around that uses a free mqh library to do HTTP post / get to a PHP file. There I store and retrieve my info / data.

In other words, I am storing all of my indicators in MySQL via an HTTP call every 30 secs. This has been a very stable solution that I have had running for the last few weeks, and it has never crashed MT4.

The file is called "ghttp.mqh"

It is in the mql4.com site, with some examples on how to use it.

Reason: