文章 "如何从 MQL5 (MQL4) 访问 MySQL 数据库" - 页 5

 
Eugeniy Lugovoy:
對於x64平台,使用下面的庫(附討論)

thank you very much!

it's very good.

 

It's very useful.

But there is a problem when i insert chinese word  into mysql use cmd like this "INSERT INTO table (name,value) VALUES ('买订单','卖订单');",it return  an  error description"Query is empty."

How to solve this problem.

Thanks. 

 

I used the attechtment dll to run EA, but it did not work and the log showed

"Cannot load 'C:\Users\ccb\AppData\Roaming\MetaQuotes\Tester\67381DD86A2959850232C0BA725E5966\Agent-127.0.0.1-3000\MQL5\libraries\MQLMySQL.dll' [193]
 Cannot call 'cMySqlVersion', '..\libraries\MQLMySQL.dll' is not loaded
 unresolved import function call"

Im using the mt5 x64

and here is my code:


#include <MQLMySQL.mqh>
//--- input parameters
string INI;
string Host, User, Password, Database, Socket; // database credentials
int Port,ClientFlag;
int DB; // database identifier
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   Print (MySqlVersion());
   INI = TerminalInfoString(TERMINAL_PATH)+"\\MQL5\\Scripts\\MyConnection.ini";
 // reading database credentials from INI file
 Host = ReadIni(INI, "MYSQL", "Host");
 User = ReadIni(INI, "MYSQL", "User");
 Password = ReadIni(INI, "MYSQL", "Password");
 Database = ReadIni(INI, "MYSQL", "Database");
 Port     = (int)StringToInteger(ReadIni(INI, "MYSQL", "Port"));
 Socket   = ReadIni(INI, "MYSQL", "Socket");
 ClientFlag = CLIENT_MULTI_STATEMENTS; //(int)StringToInteger(ReadIni(INI, "MYSQL", "ClientFlag")); 

 Print ("Host: ",Host, ", User: ", User, ", Database: ",Database);
 
 // open database connection
 Print ("Connecting...");
 
 DB = MySqlConnect(Host, User, Password, Database, Port, Socket, ClientFlag);
 
 if (DB == -1)
   Print ("Connection failed!Error: "+MySqlErrorDescription);
 else Print ("Connected!DBID#",DB);
 return 1;
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {

   MySqlDisconnect(DB);
 
     
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  
  }
//+------------------------------------------------------------------+

the X64 version dll file can not be loaded.

 
can you help me to change charset to UTF-8,thank you very much
 

I would like to ask, I did not disconnect the database operation, but the database is just beginning to connect data normal data over time, can not directly read the database information, but there is no error message

I use MT4

附加的文件:
20180412.log  2067 kb
 

win2008 Or win10 X64

run Log


2018.09.15 20:10:26.742 MySQL-001 (EURUSD,H1) Cannot load 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\67381DD86A2959850232C0BA725E5966\MQL5\libraries\MQLMySQL.dll' [193]

2018.09.15 20:10:26.742 MySQL-001 (EURUSD,H1) Cannot call 'ReadIni', '..\libraries\MQLMySQL.dll' is not loaded

2018.09.15 20:10:26.742 MySQL-001 (EURUSD,H1) unresolved import function call



SomeBody Help

 
Eugeniy Lugovoy:
對於x64平台,使用下面的庫(附討論)

win2018R2 Or win10 X86


2018.09.15 20:10:26.742 MySQL-001 (EURUSD,H1) Cannot load 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\67381DD86A2959850232C0BA725E5966\MQL5\libraries\MQLMySQL.dll' [193]
2018.09.15 20:10:26.742 MySQL-001 (EURUSD,H1) Cannot call 'ReadIni', '..\libraries\MQLMySQL.dll' is not loaded
2018.09.15 20:10:26.742 MySQL-001 (EURUSD,H1) unresolved import function call


????

 

老师你好,我用的是mt4软件,本地的win10系统使用ea连接mysql都可以正常使用,但是放到win2008服务器就不行,一直提示'..\libraries\MQLMySQL.dll' is not loaded...这样的错误,

我在上面把各个版本包括mt4,mt5,64位,32位的都下载了,但都还是用不了。请教一下该怎么办?

 
MQLMySQL库版本3.0已在GitHub上发布和发布:https://github.com/elugovoy/MQLMySQL-Project

任何进一步的修复和更新都将在GitHub存储库中进行。

现在支持代码页UTF-8。

项目保留3个目录用于:
-MQL4 x86 - 功能集
-MQL5 x64(旧式)-功能集
-MQL5 x64(类)-MQL5的类

README.md中的所有详细信息

感谢任何支持并接受PayPal:https//www.paypal.me/elugovoy
elugovoy/MQLMySQL-Project
elugovoy/MQLMySQL-Project
  • elugovoy
  • github.com
The problem of interaction of MQL with databases is not new, however it's still relevant. Use of databases can greatly enhance the possibilities of MetaTrader: storage and analysis of the price history, copying trades from one trading platform to another, providing quotes/trades in real time, heavy analytical computations on the server side...
 

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



原因: