Discussione sull’articolo "Come accedere al database MySQL da MQL5 (MQL4)" - pagina 10

 
il mio indirizzo e-mail: 178255721@qq.com
 
 
1982EAcsc :

Salve, sembra che MySQL neghi la connessione all'utente ODBC su localhost.

Puoi provare a controllare su StackOverflow: http://stackoverflow.com/questions/23950722/how-to-overcome-error-1045-28000-access-denied-for-user- odbclocalhost-u ;

how to overcome ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) permanently
how to overcome ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) permanently
  • stackoverflow.com
when am trying to open mysql in windows cmd by typing mysql. the following error is occuring. And then by looking similar queries i somehow got a temporary solution by using and then typing the password, is working...
 

Ciao Eugeniy Lugovoy.

Ho usato MQLMySQL per implementare la query comune, inserire, aggiornare, cancellare le operazioni, ma c'è un problema, non può inserire cinese, query fuori del cinese è anche confuso, vorrei chiedere, si processo di confezionamento middleware hanno impostato la codifica? Vorrei chiedere, il processo di packaging del middleware ha impostato il codice? Il fenomeno è il seguente:

GETTARE TABELLA SE ESISTE `tb_test_pat`;

CREARE TABELLA `tb_test_pat` (

`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `symbol` varchitecture

`symbol` varchar(255) NOT NULL, `start_time` datetime, `tb_test_pat`; CREARE TABLE

`start_time` datetime NOT NULL,

`ora_fine` datetime NOT NULL, `trend` int(255)

`trend` int(10) NOT NULL, `punti` int(10)

`punti` int(10) unsigned zerofill NOT NULL, `commenti` text CHARacteristic

`commenti` testo CHARACTER SET utf8,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Errore nell'inserimento del cinese

Errore: la query era vuota query: INSERT INTO tb_test_pat (trend, symbol, start_time, end_time, points, comments) VALUES (1, 'EURUSD ','2014.12.16 13:00 ','2014.12.17 20:00',8,'Test 12')

Inserimento inglese riuscito

Succeeded: INSERT INTO tb_test_pat (trend, symbol, start_time, end_time, points, comments) VALUES (1,'EURUSD','2014.12.16 13:00','2014.12.17 20 :00',8,'abc')


A cosa serve?

 
Jiayou Hu:

Ciao Eugeniy Lugovoy.

Ho usato MQLMySQL per implementare la query comune, inserire, aggiornare, cancellare le operazioni, ma c'è un problema, non può inserire cinese, query fuori del cinese è anche confuso, vorrei chiedere, si processo di confezionamento middleware hanno impostato la codifica? Vorrei chiedere, il processo di packaging del middleware ha impostato il codice? Il fenomeno è il seguente:

GETTARE TABELLA SE ESISTE `tb_test_pat`;

CREARE TABELLA `tb_test_pat` (

`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `symbol` varchitecture

`symbol` varchar(255) NOT NULL, `start_time` datetime, `tb_test_pat`; CREARE TABLE

`start_time` datetime NOT NULL,

`ora_fine` datetime NOT NULL, `trend` int(255)

`trend` int(10) NOT NULL, `punti` int(10)

`punti` int(10) unsigned zerofill NOT NULL, `commenti` text CHARacteristic

`commenti` testo CHARACTER SET utf8,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Errore nell'inserimento del cinese

Errore: la query era vuota query: INSERT INTO tb_test_pat (trend, symbol, start_time, end_time, points, comments) VALUES (1,'EURUSD','2014.12.16 13:00 ','2014.12.17 20:00',8,'Test 12')

Inserimento inglese riuscito

Succeeded: INSERT INTO tb_test_pat (trend, symbol, start_time, end_time, points, comments) VALUES (1,'EURUSD','2014.12.16 13:00','2014.12.17 20 :00',8,'abc')


A cosa serve?

Si può provare a eseguire il comando successivo dopo la connessione a MySQL.

SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', set_caratteri_server = 'utf8'

È possibile che alcune di queste impostazioni non siano impostate su UTF.

 

Un'altra soluzione è quella di eseguire i comandi successivi uno alla volta dopo la connessione.

SET NOMI 'utf8'

IMPOSTAZIONE CARATTERE 'utf8'

SET SESSIONE collation_connection = 'utf8_general_ci'

 
Eugeniy Lugovoy:

Un'altra soluzione è quella di eseguire i comandi successivi uno alla volta dopo la connessione.

SET NOMI 'utf8'

IMPOSTAZIONE CARATTERE 'utf8'

SET SESSIONE collation_connection = 'utf8_general_ci'

Non funziona ancora, ma ho trovato il problema

bool __stdcall MySqlExecute( int pConnection, wchar_t* pQuery)

{

...

char Query[16384];

sprintf_s(Query, wcslen(pQuery)+10, "%S", pQuery); // Quando si esegue questa riga, viene riscontrato il cinese e Query diventa una stringa vuota con conseguente messaggio di errore: Errore: Query era vuota query: UPDATE tb_test_pat SET commenti_test_pat SET commenti_test_pat SET commenti_test_pat SET commenti_test_pat SET commenti_test_pat SET commenti_test_pat SET commenti_test_pat test_pat SET commenti='cinese'

Potete aiutarmi a risolvere questo problema? Grazie mille! Sono a 64 bit

 
Jiayou Hu:

Non funziona ancora, ma ho trovato il problema

bool __stdcall MySqlExecute( int pConnection, wchar_t* pQuery)

{

...

char Query[16384];

sprintf_s(Query, wcslen(pQuery)+10, "%S", pQuery); // Durante l'esecuzione di questa riga, è stato riscontrato il cinese e Query è diventata una stringa vuota, con conseguente messaggio di errore: Error: Query was empty query: UPDATE tb_test_pat SET comments='Chinese'. test_pat SET commenti='cinese'

Potete aiutarmi a risolvere questo problema? Grazie mille! Sono a 64 bit

Sì, "sprintf_s" e "sprintf's" non supportano il cinese. Cercherò di aiutarvi a risolvere questo problema.
 
Anche UTF-8 non può essere usato in questo caso, ma solo UTF-16.
 
Eugeniy Lugovoy:
Anche UTF-8 non può essere usato in questo caso, ma solo UTF-16!
Che cosa significa? Significa impostare la codifica del database con UTF-16? Oppure significa convertire la stringa cinese in UTF-16?