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

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).

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

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Ошибка odbc sqlstate 42000
  • Ошибка no function definition vlax ename vla object
  • Ошибка odbc sqlstate 08001 номер ошибки 17
  • Ошибка no database selected как исправить
  • Ошибка odbc sqlstate 01000 номер ошибки 0

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии