Discussão do artigo "Como acessar o banco de dados MySQL a partir do MQL5 (MQL4)" - página 10
Você está perdendo oportunidades de negociação:
- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Registro
Login
Você concorda com a política do site e com os termos de uso
Se você não tem uma conta, por favor registre-se
Olá, parece que o MySQL nega a conexão para o usuário ODBC no localhost.
Você pode tentar verificar o StackOverflow: http://stackoverflow.com/questions/23950722/how-to-overcome-error-1045-28000-access-denied-for-user- odbclocalhost-u ;
Oi Eugeniy Lugovoy.
Usei o MQLMySQL para implementar as operações comuns de consulta, inserção, atualização e exclusão, mas há um problema: não é possível inserir chinês, a consulta fora do chinês também está distorcida. Gostaria de perguntar: o processo de empacotamento do middleware definiu o código? O fenômeno é o seguinte:
DROP TABLE IF EXISTS `tb_test_pat`;
CREATE TABLE `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`; CREATE TABLE
`start_time` datetime NOT NULL,
`end_time` datetime NOT NULL, `trend` int(255)
`trend` int(10) NOT NULL, `points` int(10)
`points` int(10) unsigned zerofill NOT NULL, `comments` text CHARacteristic
`comments` text CHARACTER SET utf8,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Falha ao inserir chinês
Erro: A consulta estava vazia Consulta: 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,'Teste 12')
Inserção em inglês bem-sucedida
Sucesso: 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')
Para que serve isso?
Oi Eugeniy Lugovoy.
Usei o MQLMySQL para implementar as operações comuns de consulta, inserção, atualização e exclusão, mas há um problema: não é possível inserir chinês, a consulta fora do chinês também está distorcida. Gostaria de perguntar: o processo de empacotamento do middleware definiu o código? O fenômeno é o seguinte:
DROP TABLE IF EXISTS `tb_test_pat`;
CREATE TABLE `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`; CREATE TABLE
`start_time` datetime NOT NULL,
`end_time` datetime NOT NULL, `trend` int(255)
`trend` int(10) NOT NULL, `points` int(10)
`points` int(10) unsigned zerofill NOT NULL, `comments` text CHARacteristic
`comments` text CHARACTER SET utf8,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Falha ao inserir chinês
Erro: A consulta estava vazia Consulta: 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,'Teste 12')
Inserção em inglês bem-sucedida
Sucesso: 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')
Para que serve isso?
Você pode tentar executar o próximo comando após a conexão do MySQL.
SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'
É possível que alguma dessas configurações não esteja definida como UTF.
Outra solução é executar os comandos seguintes um a um após a conexão.
SET NAMES 'utf8'
SET CHARACTER SET 'utf8'
SET SESSION collation_connection = 'utf8_general_ci'
Outra solução é executar os comandos seguintes um a um após a conexão.
SET NAMES 'utf8'
SET CHARACTER SET 'utf8'
SET SESSION collation_connection = 'utf8_general_ci'
Ainda não está funcionando, mas encontrei o problema
bool __stdcall MySqlExecute( int pConnection, wchar_t* pQuery)
{
...
char Query[16384];
sprintf_s(Query, wcslen(pQuery)+10, "%S", pQuery); // Ao executar essa linha, o idioma chinês é encontrado e Query se torna uma cadeia vazia, resultando em uma mensagem de erro: Error: Query was empty query: UPDATE tb_test_pat SET comments_test_pat SET comments_test_pat SET comments_test_pat SET comments_test_pat SET comments_test_pat SET comments_test_pat test_pat SET comments='Chinese'
Você pode me ajudar a corrigir esse problema? Muito obrigado! Eu tenho 64 bits
Ainda não está funcionando, mas encontrei o problema
bool __stdcall MySqlExecute( int pConnection, wchar_t* pQuery)
{
...
char Query[16384];
sprintf_s(Query, wcslen(pQuery)+10, "%S", pQuery); // Ao executar essa linha, o idioma chinês foi encontrado e a Query se tornou uma string vazia, resultando em uma mensagem de erro: Error: Query was empty query: UPDATE tb_test_pat SET comments='Chinese'. test_pat SET comments='Chinese'
Você pode me ajudar a corrigir esse problema? Muito obrigado! Eu tenho 64 bits
Além disso, o UTF-8 não pode ser usado nesse caso, mas somente o UTF-16!