Discussion of article "How to Access the MySQL Database from MQL5 (MQL4)" - page 8

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
Hello James,
I'm working at Upwork only on one big project currently. So, have no much free time nowadays. What's the problem you have with libs? How can I help you?
Why did everything stop working after upgrading to build 890 mt4?
The log says Access violation read to 0x00000000 in 'D:\MT4\MQL4\libraries\MQLMySQL.dll'.
also interested in ...
Looking forward to it!
MT4 build 890 x32 just checked. Everything works.
Log of running test scripts:
Guys, clarify:
1. On what operation it gives"Access violation read" ?
2. When running the MySQL-001 script, what version of MQLMySQL is shown on the Experts tab? should be: MQLMySQL v2.2 x32 Copyright © 2014, FxCodex Laboratory
3. What version of MySQL database?
4. Is MySQL used locally or on a remote host?
5. Under which operating system do you run the terminal?
Please check and report back, as I can't reproduce the error.
I will create a similar environment and test.
Hello,
Here goes the problem:
Any ideas of what could possibly have gone wrong?
Thanks in advance!
Hello,
Here goes the problem:
Any ideas of what could possibly have gone wrong?
Thanks in advance!
Hello Peg,
To create table use SQL command CREATE TABLE http://dev.mysql.com/doc/refman/5.7/en/create-table.html
For inserting data use SQL command INSERT INTO https://dev.mysql.com/doc/refman/5.6/en/insert.html
To execute such commands use the function MySqlExecute.
Also you can provide your code and I would be able to figure out the problem.
Hello Peg,
To create table use SQL command CREATE TABLE http://dev.mysql.com/doc/refman/5.7/en/create-table.html
For inserting data use SQL command INSERT INTO https://dev.mysql.com/doc/refman/5.6/en/insert.html
To execute such commands use the function MySqlExecute.
Also you can provide your code and I would be able to figure out the problem.
Hello Eugeniy,
Thank you for the links.
At first I used your code to connect to my database (I was using mySql Server in case it is useful). And I could see the table. Then I changed the table's name at your MySQL-002 Script (as you can see below) and thought it seemed to work it wouldn't create my table. Now I'm using WampServer and I get:
0 11:09:37.579 Script MySQL-002 EURUSD,H1: loaded successfully
0 11:09:37.730 MySQL-002 EURUSD,H1: initialized
0 11:09:37.730 MySQL-002 EURUSD,H1: MQLMySQL v2.0 Demo Copyright © 2014, FxCodex Laboratory
0 11:09:37.730 MySQL-002 EURUSD,H1: Host: , User: , Database:
0 11:09:37.730 MySQL-002 EURUSD,H1: Connecting...
0 11:09:37.741 MySQL-002 EURUSD,H1: Connected! DBID#0
0 11:09:37.742 MySQL-002 EURUSD,H1: Table `table` cannot be created. Error: Aucune base n'a ?t? s?lectionn?e
0 11:09:37.742 MySQL-002 EURUSD,H1: Disconnected. Script done!
0 11:09:37.742 MySQL-002 EURUSD,H1: uninit reason 0
0 11:09:37.743 Script MySQL-002 EURUSD,H1: removed
Hello Eugeniy,
Thank you for the links.
At first I used your code to connect to my database (I was using mySql Server in case it is useful). And I could see the table. Then I changed the table's name at your MySQL-002 Script (as you can see below) and thought it seemed to work it wouldn't create my table. Now I'm using WampServer and I get:
0 11:09:37.579 Script MySQL-002 EURUSD,H1: loaded successfully
0 11:09:37.730 MySQL-002 EURUSD,H1: initialized
0 11:09:37.730 MySQL-002 EURUSD,H1: MQLMySQL v2.0 Demo Copyright © 2014, FxCodex Laboratory
0 11:09:37.730 MySQL-002 EURUSD,H1: Host: , User: , Database:
0 11:09:37.730 MySQL-002 EURUSD,H1: Connecting...
0 11:09:37.741 MySQL-002 EURUSD,H1: Connected! DBID#0
0 11:09:37.742 MySQL-002 EURUSD,H1: Table `table` cannot be created. Error: Aucune base n'a ?t? s?lectionn?e
0 11:09:37.742 MySQL-002 EURUSD,H1: Disconnected. Script done!
0 11:09:37.742 MySQL-002 EURUSD,H1: uninit reason 0
0 11:09:37.743 Script MySQL-002 EURUSD,H1: removed
Based on error I see from your log: 0 11:09:37.742 MySQL-002 EURUSD,H1: Table `table` cannot be created.
you are uses name "table" which is keyword of mysql database and cannot be used as table name, try to change to for example to "table1" just to check is it works.
or possible the database was not selected or was not set. you can execute command "USE database_name" right after connection, where the database_name is the name of your database.
for example if my database is "mysql":
DB = MySqlConnect(Host, User, Password, Database, Port, Socket, ClientFlag);
if (DB == -1) { Print ("Connection failed! Error: "+MySqlErrorDescription); } else { Print ("Connected! DBID#",DB);}
MySqlExecute(DB, "USE mysql");