Discussion of article "How to Access the MySQL Database from MQL5 (MQL4)" - page 27
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Please can someone confirm is I'm using the right connection string
I'm using "127.0.0.1" for the host
I'm using the user , pass , and database in quotes ( 3 seperate parameters )
I'm then puttting NULL for the socket and 0 for the client flag.
( My system is Win 10 )
I get an error saying no database connection when I try to execute an insert
First of all, make sure that you have dll loaded (no error 126 or so), then set the socket = ""; but not NULL
Next, the library has variable SQLTrace you can set to true and see the logs of errors.
Depends on logs you see, you would be able to check MySQL documentation for solving issue.
hello Eugeniy
I just started programming in MQL5, and trying out this mysql in MQL5,
i already copied x64 bit version into libraries folder and getting strange error, perhaps if you or anyone can help with the problem.
i will attach screen shot below
https://c.mql5.com/3/359/mysqlerror.png
thx
Can anyone help me solve the same situation?
Thank you~~~~
You can update mfc, i solove this error for update mfc.
https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170
I can't read the contents of my connection file on the operating system win2019. What's the reason? With the guidance of that expert, thank you
I can't read the contents of my connection file on the operating system win2019. What's the reason? With the guidance of that expert, thank you
As I can see from the logs the host, user and database are empty, so you are connecting to nowhere. make sure your .ini file is located in right directory. probably UAC changed the directory of terminal.
probably UAC changed the directory of terminal. for testing you may set database credentials directly in EA and make sure of successful connection.  For testing you may set database credentials directly in EA and make sure of successful connection. 
Hello friends,
Well, if you like this solution and trying it for real projects (not just for fun) I have an update.
I'm starting to write new article about working with different databases, such as MS SQL Server, MS Access, Oracle, IBM DB/2, PostgreSQL.
The decision would be robust and easy to use like this one, but I have no time to complete it.
So, if you want to support this project can you send a few $$ over paypal for me: e.a.lugovoy@gmail.com
The amount of sum doesn't matter, I just would like to know is such decision really needs to be completed.
Thank you all,
Eugene
@Eugeniy Lugovoy I think this is a very good idea, have you looked into it further? I think it would be good to first wrap these via either interfaces or abstract classes and then implement. I think a connection pool with background keep-alive/timeout will be handy as a start. I am a dev myself and can help out too.
Also, I assume this library doesn't do connection pooling yet? This one seems to be using 8.0.18 that was released about 2.5 years ago in Sept 2019. There are more updated versions available. Can this be updated to use latest version please?
Can someone confirm that can it possible use "LOAD DATA LOCAL INFILE" in query with this.
Because I try to use it so many time but failed.
Thank you.
I can access Mysql from MT5 well but it just can't use the query "LOAD DATA LOCAL INFILE" it's nothing happen.
Can anyone help? thank you.
I try to print the error it show below:(I think maybe the query contents is too long)?
2022.08.28 15:11:27.151 MT52DB_Netting (MYM-U22,D1) CMD>1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'D:/Data_02/MT5/KGI/MQL5/Files/3000586_His.csv INTO TABLE `3000586_His` FIELDS TE' at line 1
Hi~
I also had the error question of [126]:
Cannot load'C:\Users\programer01\Desktop\MyMT5\MQL5\Libraries\MQLMySQL.dll' [126]
Cannot call'cMySqlVersion','MQLMySQL.dll' is not loaded
unresolved import function call
MARCOSmentioned that it is normal after updating the OpenSSL version
How can I update the OpenSSL version?
Thank you! ~
PS.
Because I am not familiar with this field
I want to ask again
I see that there are three dll files in your Libraries folder
1.libcrypto-1_1-x64.dll
2.libmysql.dll
3.libssl-1_1-x64.dll
I have installed MySQL software
Are these dll files copied from the path under ..\Program Files\MySQL?
If so, which folder was copied from?
I just solved updating Visual Studio.
You can download a latest version from this link -- https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170