Kod: Zaznacz cały
2010.06.16 21:57:33 TicksInMySQL EURUSD,M30: cannot load library 'libmysql.dll' (error 126)
taki log z mt4 experts
http://forum.mql4.com/6744
podpowiedz nic mi nie mówi ... walczył już ktoś z tym problemem?
EDIT: odpowiedz w AD.1
kod:
Kod: Zaznacz cały
//+------------------------------------------------------------------+
//| TicksInMySQL.mq4 |
//| Copyright © 2006, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#import "libmysql.dll"
int mysql_init(int db);
int mysql_errno(int TMYSQL);
int mysql_real_connect(int TMYSQL, string host, string user, string password,
string DB,int port,int socket,int clientflag);
int mysql_real_query(int TMSQL, string query, int length);
void mysql_close(int TMSQL);
#import
int mysql;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
mysql = mysql_init(mysql);
if(mysql != 0)
Print("allocated");
string host = "localhost";
string user = "user";
string password = "pwd";
string DB = "mt4";
int clientflag = 0;
int port = 3306;
string socket = "";
int res = mysql_real_connect(mysql,host,user,password,DB,port,socket,clientflag);
int err = GetLastError();
if(res == mysql)
Print("connected");
else
Print("error=", mysql, " ", mysql_errno(mysql), " ");
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
mysql_close(mysql);
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
string query = "";
int length = 0;
query = StringConcatenate("insert into ticks(margin,freemargin,date,ask,bid,symbol,equity) values(",
AccountMargin(), ",", AccountFreeMargin(), ","",
TimeToStr(CurTime(), TIME_DATE|TIME_SECONDS), "",",
NormalizeDouble(Ask, 4), ",", NormalizeDouble(Bid, 4),
","", Symbol(), "",", AccountEquity(), ");");
length = StringLen(query);
mysql_real_query(mysql, query, length);
int myerr = mysql_errno(mysql);
if(myerr > 0)
Print("error=",myerr);
}
//+------------------------------------------------------------------+
Dodano po 23 godzinach 12 minutach:
AD.1
fryk pisze:A wiec aby moc korzystac z dobrodziejstw bazy danych MySQL nalezy zainstalowac i uruchomic serwer np lokalnie (mysql.com). Nastepnie skopiowac biblioteke "libmysql.dll" z katalogu MYSQL/bin/ do MT4/experts/include.
MT4/experts/libraries - przynajmniej u mnie wtedy coś się dzieje
Kod: Zaznacz cały
21:57:27 TicksInMySQL EURUSD,M30: cannot load library 'libmysql.dll' (error 126)
ale dalej jakaś masakra ..
Kod: Zaznacz cały
21:57:27 TicksInMySQL EURUSD,M30: expert stopped
21:57:27 TicksInMySQL EURUSD,M30: initialized
23:52:28 TicksInMySQL EURUSD,M30: shutdown by timeout
23:52:28 TicksInMySQL EURUSD,M30: terminated by timeout
23:52:31 TicksInMySQL EURUSD,H1: function 'mysql_init' call from dll 'libmysql.dll' not confirmed
23:52:31 TicksInMySQL EURUSD,H1: expert stopped
23:52:31 TicksInMySQL EURUSD,H1: initialized
23:52:33 TicksInMySQL EURUSD,H1: shutdown by timeout
23:52:42 TicksInMySQL EURUSD,H1: terminated by timeout
23:52:44 TicksInMySQL EURUSD,M30: allocated
23:52:49 TicksInMySQL EURUSD,M30: error=61621128 1045
23:52:49 TicksInMySQL EURUSD,M30: initialized
23:53:12 TicksInMySQL EURUSD,M30: shutdown by timeout
23:53:12 TicksInMySQL EURUSD,M30: terminated by timeout
23:53:12 TicksInMySQL EURUSD,H1: allocated
23:53:12 TicksInMySQL EURUSD,H1: error=61621128 1045
23:53:12 TicksInMySQL EURUSD,H1: initialized
23:53:15 TicksInMySQL EURUSD,H1: error=2006
23:53:50 TicksInMySQL EURUSD,H1: error=2006
23:54:02 Compiling 'TicksInMySQL'
23:54:02 TicksInMySQL EURUSD,H1: terminated by timeout
23:54:13 TicksInMySQL EURUSD,H1: function 'mysql_close' call from dll 'libmysql.dll' not confirmed
23:54:13 TicksInMySQL EURUSD,H1: expert stopped
23:54:13 TicksInMySQL EURUSD,H1: deinitialized
23:54:13 TicksInMySQL EURUSD,H1: uninit reason 3
23:54:29 TicksInMySQL EURUSD,H4: allocated
23:54:29 TicksInMySQL EURUSD,H4: error=61621128 1045
23:54:29 TicksInMySQL EURUSD,H4: initialized
23:54:31 TicksInMySQL EURUSD,H4: error=2006
23:54:34 TicksInMySQL EURUSD,H4: shutdown by timeout
23:54:43 TicksInMySQL EURUSD,H4: terminated by timeout
23:54:46 TicksInMySQL EURUSD,H1: allocated
23:54:46 TicksInMySQL EURUSD,H1: error=61621128 1045
23:54:46 TicksInMySQL EURUSD,H1: initialized
23:58:50 TicksInMySQL EURUSD,H1: deinitialized
23:58:50 TicksInMySQL EURUSD,H1: uninit reason 2
23:58:50 TicksInMySQL EURUSD,H1: loaded successfully
23:58:51 TicksInMySQL EURUSD,H1: allocated
23:59:04 TicksInMySQL EURUSD,H1: error=96708080 1045
23:59:04 TicksInMySQL EURUSD,H1: initialized
23:59:04 TicksInMySQL EURUSD,H1: error=2006
23:59:14 TicksInMySQL EURUSD,H1: error=2006
23:59:18 TicksInMySQL EURUSD,H1: error=2006
23:59:20 TicksInMySQL EURUSD,H1: error=2006
wredniaha pisze:Miał też problemy z odnawianiem połączenia do serwera MySQL jeśli te wygasło. Przeryłem cały net, przeanalizowałem sprawę kilkukrotnie i się poddałem.
mt4 się często sypie ... okienko z listą .dll
Chyba biblioteka trochę mało przyjazna .. używa jej ktoś bez problemów?
R.E.P.T.I.L.E. - Robotic Electronic Person Trained for Infiltration and Logical Exploration (off-line,only e-mail)