Ошибка odbc sqlstate hy000 номер ошибки 2003

Внешние источники подключения — ошибка ODBC:SQLSTATE HY000
Ø (Лефмихалыч 12.02.2018 07:20) ☑ 0

Roma1314704

11.02.18

13:39

Не могу понять суть ошибки при подключении к внешнем источникам

Создание таблиц — выбрать из списка таблиц —

DRIVER={MySQL ODBC 3.51 Driver};SERVER=94.249.146.189;DataBase=users;charset=cp1251;UID=***;PWD=*****

логин и пароль 100% правильные

Получаю ошибку  —

Ошибка ODBC:SQSTATE HY000

Номер ошибки: 2003

1

Лефмихалыч

11.02.18

13:44

а чем-нибудь еще, кроме ODBC, ты к этому серверу оттуда же можешь подключиться? heidisql — напрмер

2

Roma1314704

11.02.18

14:12

нету другой возможности

3

Лефмихалыч

11.02.18

14:33

(2) заставь себя скачать портабельный heidisql и проверить возможность соединения чем-то, кроме ODBC. Будь мужиком.

4

glebgleb

11.02.18

16:59

(2) Программирование оказывается крепче пальца, которым в него тыкают.

1) google://»ODBC:SQLSTATE HY000 Номер ошибки 2003″

2) В ошибке кроме статуса и номера есть еще и описание, в котором что-то говорится. Читать его мы конечно не будем.

5

glebgleb

11.02.18

17:05

Хинт — с чего ты взял, что товарищи из сети GHOSTnet GmbH позволят тебе тыкать пальцем в MySql снаружи?

6

rphosts

11.02.18

17:41

(0) поставь DBeaver — у него свои дрова(JDBC) в комплекте. Если им коннектится — ищи проблему со стороны 1С или того компа с которого 1С туда лезет (там где выполняется серверный контекст).

7

Roma1314704

11.02.18

19:18

Есть строка подключения для DBeaver ? Или им только просматривать базу ?

8

Лефмихалыч

11.02.18

20:48

(5) https://turbosms.ua/sqlinfo.html

таки разрешат

(7) самое главное — сиди на попе ровно, продолжай задавать пустые вопросы, ничего руками не трогай и не пробуй ничего сделать самостоятельно. Жди, когда проблема решит сама себя по волшебству.

9

Roma1314704

11.02.18

21:19

При чем здесь эта ссылка?

I have the following error message:

SQLSTATE[HY000] [2003] Can’t connect to MySQL server on
‘192.168.50.45’ (4)

How would I parse this (I have HY000, I have 2003 and I have the (4).

Charles's user avatar

Charles

50.9k13 gold badges104 silver badges142 bronze badges

asked Jun 27, 2012 at 16:43

Itay Moav -Malimovka's user avatar

7

HY000 is a very general ODBC-level error code, and 2003 is the MySQL-specific error code that means that the initial server connection failed. 4 is the error code from the failed OS-level call that the MySQL driver tried to make. (For example, on Linux you will see «(111)» when the connection was refused, because the connect() call failed with the ECONNREFUSED error code, which has a value of 111.)

MvG's user avatar

MvG

56.9k22 gold badges145 silver badges275 bronze badges

answered Jun 27, 2012 at 16:47

cdhowie's user avatar

2

Using the perror tool that comes with MySQL:

shell> perror 4
OS error code   4:  Interrupted system call

It might a bug where incorrect error is reported, in this case, it might a simple connection timeout (errno 111)

answered Jun 27, 2012 at 21:23

geertjanvdk's user avatar

geertjanvdkgeertjanvdk

3,40023 silver badges26 bronze badges

FWIW, having spent around 2-3 months looking into this in a variety of ways, we have come to the conclusion that (at least for us), the (4) error happen when the network is too full of data for the connection to complete in a sane amount of time. from our investigations, the (4) occurs midway through the handshaking process.
You can see this in a unix environment by using ‘netem’ to fake network congestion.

The quick solution is to up the connection timeout parameter. This will hide any (4) error, but may not be the solution to the issue.
The real solution is to see what is happeneing at the DB end at the time. If you are processing a lot of data when this happens, it may be a good ideas to see if you can split this into smaller chunks, or even pas the processing to a different server, if you have that luxury.

answered Jun 27, 2013 at 16:29

Peter Colclough's user avatar

I happened to face this problem. Increase the connect_timeout worked out finally.

answered Aug 16, 2013 at 16:07

hahakubile's user avatar

hahakubilehahakubile

6,8504 gold badges28 silver badges18 bronze badges

I was just struggling with the same issue.

Disable the DNS hostname lookups solved the issue for me.

[mysqld]


skip-name-resolve

Don’t forget to restart MySQL to take effect.

answered Oct 17, 2013 at 4:07

NiX's user avatar

@cdhowie While you may be right in other circumstances, with that particular error the (4) is a mysql client library error, caused by a failed handshake. Its actually visible in the source code. The normal reason is too much data causing an internal timeout. Making ‘room’ for the connection normally sorts it without masking the issue, like upping the timeout or increasing bandwidth.

answered Jul 19, 2014 at 16:34

WoodyGSD's user avatar

I have the following error message:

SQLSTATE[HY000] [2003] Can’t connect to MySQL server on
‘192.168.50.45’ (4)

How would I parse this (I have HY000, I have 2003 and I have the (4).

Charles's user avatar

Charles

50.7k13 gold badges103 silver badges142 bronze badges

asked Jun 27, 2012 at 16:43

Itay Moav -Malimovka's user avatar

7

HY000 is a very general ODBC-level error code, and 2003 is the MySQL-specific error code that means that the initial server connection failed. 4 is the error code from the failed OS-level call that the MySQL driver tried to make. (For example, on Linux you will see «(111)» when the connection was refused, because the connect() call failed with the ECONNREFUSED error code, which has a value of 111.)

MvG's user avatar

MvG

56.2k20 gold badges142 silver badges272 bronze badges

answered Jun 27, 2012 at 16:47

cdhowie's user avatar

2

Using the perror tool that comes with MySQL:

shell> perror 4
OS error code   4:  Interrupted system call

It might a bug where incorrect error is reported, in this case, it might a simple connection timeout (errno 111)

answered Jun 27, 2012 at 21:23

geertjanvdk's user avatar

geertjanvdkgeertjanvdk

3,33023 silver badges26 bronze badges

FWIW, having spent around 2-3 months looking into this in a variety of ways, we have come to the conclusion that (at least for us), the (4) error happen when the network is too full of data for the connection to complete in a sane amount of time. from our investigations, the (4) occurs midway through the handshaking process.
You can see this in a unix environment by using ‘netem’ to fake network congestion.

The quick solution is to up the connection timeout parameter. This will hide any (4) error, but may not be the solution to the issue.
The real solution is to see what is happeneing at the DB end at the time. If you are processing a lot of data when this happens, it may be a good ideas to see if you can split this into smaller chunks, or even pas the processing to a different server, if you have that luxury.

answered Jun 27, 2013 at 16:29

Peter Colclough's user avatar

I happened to face this problem. Increase the connect_timeout worked out finally.

answered Aug 16, 2013 at 16:07

hahakubile's user avatar

hahakubilehahakubile

6,5204 gold badges28 silver badges18 bronze badges

I was just struggling with the same issue.

Disable the DNS hostname lookups solved the issue for me.

[mysqld]


skip-name-resolve

Don’t forget to restart MySQL to take effect.

answered Oct 17, 2013 at 4:07

NiX's user avatar

@cdhowie While you may be right in other circumstances, with that particular error the (4) is a mysql client library error, caused by a failed handshake. Its actually visible in the source code. The normal reason is too much data causing an internal timeout. Making ‘room’ for the connection normally sorts it without masking the issue, like upping the timeout or increasing bandwidth.

answered Jul 19, 2014 at 16:34

WoodyGSD's user avatar

Ø [Лефмихалыч,
12.02.18 — 07:20]

Я
   Roma1314704

11.02.18 — 13:39

Не могу понять суть ошибки при подключении к внешнем источникам

Создание таблиц — выбрать из списка таблиц —

DRIVER={MySQL ODBC 3.51 Driver};SERVER=94.249.146.189;DataBase=users;charset=cp1251;UID=***;PWD=*****

логин и пароль 100% правильные

Получаю ошибку  —

Ошибка ODBC:SQSTATE HY000

Номер ошибки: 2003

   Лефмихалыч

1 — 11.02.18 — 13:44

а чем-нибудь еще, кроме ODBC, ты к этому серверу оттуда же можешь подключиться? heidisql — напрмер

   Roma1314704

2 — 11.02.18 — 14:12

нету другой возможности

   Лефмихалыч

3 — 11.02.18 — 14:33

(2) заставь себя скачать портабельный heidisql и проверить возможность соединения чем-то, кроме ODBC. Будь мужиком.

   glebgleb

4 — 11.02.18 — 16:59

(2) Программирование оказывается крепче пальца, которым в него тыкают.

1) google://»ODBC:SQLSTATE HY000 Номер ошибки 2003″

2) В ошибке кроме статуса и номера есть еще и описание, в котором что-то говорится. Читать его мы конечно не будем.

   glebgleb

5 — 11.02.18 — 17:05

Хинт — с чего ты взял, что товарищи из сети GHOSTnet GmbH позволят тебе тыкать пальцем в MySql снаружи?

   rphosts

6 — 11.02.18 — 17:41

(0) поставь DBeaver — у него свои дрова(JDBC) в комплекте. Если им коннектится — ищи проблему со стороны 1С или того компа с которого 1С туда лезет (там где выполняется серверный контекст).

   Roma1314704

7 — 11.02.18 — 19:18

Есть строка подключения для DBeaver ? Или им только просматривать базу ?

   Лефмихалыч

8 — 11.02.18 — 20:48

(5) https://turbosms.ua/sqlinfo.html

таки разрешат

(7) самое главное — сиди на попе ровно, продолжай задавать пустые вопросы, ничего руками не трогай и не пробуй ничего сделать самостоятельно. Жди, когда проблема решит сама себя по волшебству.

  

Roma1314704

9 — 11.02.18 — 21:19

При чем здесь эта ссылка?

TurboConf — расширение возможностей Конфигуратора 1С

ВНИМАНИЕ! Если вы потеряли окно ввода сообщения, нажмите Ctrl-F5 или Ctrl-R или кнопку «Обновить» в браузере.

Тема не обновлялась длительное время, и была помечена как архивная. Добавление сообщений невозможно.
Но вы можете создать новую ветку и вам обязательно ответят!
Каждый час на Волшебном форуме бывает более 2000 человек.

I have the following error message:

SQLSTATE[HY000] [2003] Can’t connect to MySQL server on
‘192.168.50.45’ (4)

How would I parse this (I have HY000, I have 2003 and I have the (4).

Charles's user avatar

Charles

50.7k13 gold badges103 silver badges142 bronze badges

asked Jun 27, 2012 at 16:43

Itay Moav -Malimovka's user avatar

7

HY000 is a very general ODBC-level error code, and 2003 is the MySQL-specific error code that means that the initial server connection failed. 4 is the error code from the failed OS-level call that the MySQL driver tried to make. (For example, on Linux you will see «(111)» when the connection was refused, because the connect() call failed with the ECONNREFUSED error code, which has a value of 111.)

MvG's user avatar

MvG

56.2k20 gold badges142 silver badges272 bronze badges

answered Jun 27, 2012 at 16:47

cdhowie's user avatar

2

Using the perror tool that comes with MySQL:

shell> perror 4
OS error code   4:  Interrupted system call

It might a bug where incorrect error is reported, in this case, it might a simple connection timeout (errno 111)

answered Jun 27, 2012 at 21:23

geertjanvdk's user avatar

geertjanvdkgeertjanvdk

3,33023 silver badges26 bronze badges

FWIW, having spent around 2-3 months looking into this in a variety of ways, we have come to the conclusion that (at least for us), the (4) error happen when the network is too full of data for the connection to complete in a sane amount of time. from our investigations, the (4) occurs midway through the handshaking process.
You can see this in a unix environment by using ‘netem’ to fake network congestion.

The quick solution is to up the connection timeout parameter. This will hide any (4) error, but may not be the solution to the issue.
The real solution is to see what is happeneing at the DB end at the time. If you are processing a lot of data when this happens, it may be a good ideas to see if you can split this into smaller chunks, or even pas the processing to a different server, if you have that luxury.

answered Jun 27, 2013 at 16:29

Peter Colclough's user avatar

I happened to face this problem. Increase the connect_timeout worked out finally.

answered Aug 16, 2013 at 16:07

hahakubile's user avatar

hahakubilehahakubile

6,5204 gold badges28 silver badges18 bronze badges

I was just struggling with the same issue.

Disable the DNS hostname lookups solved the issue for me.

[mysqld]


skip-name-resolve

Don’t forget to restart MySQL to take effect.

answered Oct 17, 2013 at 4:07

NiX's user avatar

@cdhowie While you may be right in other circumstances, with that particular error the (4) is a mysql client library error, caused by a failed handshake. Its actually visible in the source code. The normal reason is too much data causing an internal timeout. Making ‘room’ for the connection normally sorts it without masking the issue, like upping the timeout or increasing bandwidth.

answered Jul 19, 2014 at 16:34

WoodyGSD's user avatar

Перейти к контенту

Ø [Лефмихалыч,
12.02.18 — 07:20]

Я
   Roma1314704

11.02.18 — 13:39

Не могу понять суть ошибки при подключении к внешнем источникам

Создание таблиц — выбрать из списка таблиц —

DRIVER={MySQL ODBC 3.51 Driver};SERVER=94.249.146.189;DataBase=users;charset=cp1251;UID=***;PWD=*****

логин и пароль 100% правильные

Получаю ошибку  —

Ошибка ODBC:SQSTATE HY000

Номер ошибки: 2003

   Лефмихалыч

1 — 11.02.18 — 13:44

а чем-нибудь еще, кроме ODBC, ты к этому серверу оттуда же можешь подключиться? heidisql — напрмер

   Roma1314704

2 — 11.02.18 — 14:12

нету другой возможности

   Лефмихалыч

3 — 11.02.18 — 14:33

(2) заставь себя скачать портабельный heidisql и проверить возможность соединения чем-то, кроме ODBC. Будь мужиком.

   glebgleb

4 — 11.02.18 — 16:59

(2) Программирование оказывается крепче пальца, которым в него тыкают.

1) google://»ODBC:SQLSTATE HY000 Номер ошибки 2003″

2) В ошибке кроме статуса и номера есть еще и описание, в котором что-то говорится. Читать его мы конечно не будем.

   glebgleb

5 — 11.02.18 — 17:05

Хинт — с чего ты взял, что товарищи из сети GHOSTnet GmbH позволят тебе тыкать пальцем в MySql снаружи?

   rphosts

6 — 11.02.18 — 17:41

(0) поставь DBeaver — у него свои дрова(JDBC) в комплекте. Если им коннектится — ищи проблему со стороны 1С или того компа с которого 1С туда лезет (там где выполняется серверный контекст).

   Roma1314704

7 — 11.02.18 — 19:18

Есть строка подключения для DBeaver ? Или им только просматривать базу ?

   Лефмихалыч

8 — 11.02.18 — 20:48

(5) https://turbosms.ua/sqlinfo.html

таки разрешат

(7) самое главное — сиди на попе ровно, продолжай задавать пустые вопросы, ничего руками не трогай и не пробуй ничего сделать самостоятельно. Жди, когда проблема решит сама себя по волшебству.

  

Roma1314704

9 — 11.02.18 — 21:19

При чем здесь эта ссылка?

ВНИМАНИЕ! Если вы потеряли окно ввода сообщения, нажмите Ctrl-F5 или Ctrl-R или кнопку «Обновить» в браузере.

Тема не обновлялась длительное время, и была помечена как архивная. Добавление сообщений невозможно.
Но вы можете создать новую ветку и вам обязательно ответят!
Каждый час на Волшебном форуме бывает более 2000 человек.

If you are running Ubuntu via WSL (Windows Subsystem for Linux) and wish to connect to the MySQL instance on the host machine, you will need to use the host machine’s IPv4 address e.g. 192.X.X.X, not 127.0.0.1 or localhost.

$ mysql -u <user> -h 127.0.0.1 -p -P 3306

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)
$ mysql -u <user> -h 192.X.X.X -p -P 3306

Welcome to the MySQL monitor...Server version: 8.0.26 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>

To check your IPv4 address, go to Settings -> Network $ Internet -> Properties -> IPv4 address.

I got the same error configuring MySQL URI for apache airflow as:

mysql+mysqlconnector://<user>:<password>@localhost:3306/<database>

(mysql.connector.errors.DatabaseError) 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (111)

or

mysql+mysqlconnector://<user>:<password>@127.0.0.1:3306/<database>

(mysql.connector.errors.DatabaseError) 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)

Fixed the error configuring the URI as:

mysql+mysqlconnector://<user>:<password>@192.X.X.X:3306/<database>

If you are running Ubuntu via WSL (Windows Subsystem for Linux) and wish to connect to the MySQL instance on the host machine, you will need to use the host machine’s IPv4 address e.g. 192.X.X.X, not 127.0.0.1 or localhost.

$ mysql -u <user> -h 127.0.0.1 -p -P 3306

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)
$ mysql -u <user> -h 192.X.X.X -p -P 3306

Welcome to the MySQL monitor...Server version: 8.0.26 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>

To check your IPv4 address, go to Settings -> Network $ Internet -> Properties -> IPv4 address.

I got the same error configuring MySQL URI for apache airflow as:

mysql+mysqlconnector://<user>:<password>@localhost:3306/<database>

(mysql.connector.errors.DatabaseError) 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (111)

or

mysql+mysqlconnector://<user>:<password>@127.0.0.1:3306/<database>

(mysql.connector.errors.DatabaseError) 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)

Fixed the error configuring the URI as:

mysql+mysqlconnector://<user>:<password>@192.X.X.X:3306/<database>

If you are running Ubuntu via WSL (Windows Subsystem for Linux) and wish to connect to the MySQL instance on the host machine, you will need to use the host machine’s IPv4 address e.g. 192.X.X.X, not 127.0.0.1 or localhost.

$ mysql -u <user> -h 127.0.0.1 -p -P 3306

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)
$ mysql -u <user> -h 192.X.X.X -p -P 3306

Welcome to the MySQL monitor...Server version: 8.0.26 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql>

To check your IPv4 address, go to Settings -> Network $ Internet -> Properties -> IPv4 address.

I got the same error configuring MySQL URI for apache airflow as:

mysql+mysqlconnector://<user>:<password>@localhost:3306/<database>

(mysql.connector.errors.DatabaseError) 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (111)

or

mysql+mysqlconnector://<user>:<password>@127.0.0.1:3306/<database>

(mysql.connector.errors.DatabaseError) 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)

Fixed the error configuring the URI as:

mysql+mysqlconnector://<user>:<password>@192.X.X.X:3306/<database>

При попытке подключиться к MySQL или Percona сервер с настройками по-умолчанию с другой рабочей станции или сервера, можно получить ошибку
ERROR 2003 (HY000): Can’t connect to MySQL server on ‘xx.xx.xx.xx’ (111)

Далее описаны 3 шага, которые нужно пройти для установления соединения.

The first thing we can check is to see if the user from the remote host is allowed.

1. Login as root on mysql server
mysql -u root -p

2. Select database and show users.
select * from mysql.userG

**A vertical list will be displayed. Look at the first two fields for each entry. If the user is only allowed to connect from localhost, this may be the problem.
Example:

Host: localhost
User: mydbuser

A user will have to be defined with the same parameters as mydbuser for the remote host (or hosts)
Here’s where your documentation will come in handy (or you can hope the old query exists in the mysql buffer!)

3. Allow remote hosts to connect
grant select,insert,update,delete,create,drop,index,alter on mydbname.* to mydbuser@’192.168.1.%’ identified by ‘mydbpassword’ ;

flush privileges;

Note: if you only want to allow a certain host, specify the IP instead of the wildcard.

The second issue that may cause this error is a MySQL configuration.

1. Open MySQL config file
nano /etc/my.cnf

2. Ensure that the following are commented out.

#skip-external-locking
#skip-networking
#bind-address = xx.xx.xx.xx

Save and exit

3. Restart mysql service
service mysqld start

The third issue that may contribute to this error may be the security configuration rejecting incoming requests on the server.

1. Login as root on db server

2. Add rule to iptables
/sbin/iptables -A INPUT -i eth0 -s 192.168.1.0/24 -p tcp —destination-port 3306 -j ACCEPT

** this grants access to the entire subnet, use a specific IP where applicable.

service iptables save

3. Restart iptables service
service iptables restart

Test from remote host by using the following:
mysql -h 192.168.my.dbip -u mydbuser -p

Описание ошибки: [MySQL][ODBC 5.1 Driver]Can’t connect to MySQL server on ‘ip-адрес'(10060)
MySQL-сервер стоит на Windows 8. В брэндмауэре порт 3306 открыт для входящих подключений.
В чем может быть проблема?


  • Вопрос задан

    более трёх лет назад

  • 493 просмотра

  • Ошибка odbc sqlstate hy000 номер ошибки 104
  • Ошибка odbc sqlstate 42s22 номер ошибки 207
  • Ошибка odbc sqlstate 42s02 номер ошибки 208
  • Ошибка odbc sqlstate 42s02 номер ошибки 1305
  • Ошибка odbc sqlstate 42000 номер ошибки 156