no connection established mysql workbench что делать

MySQL Workbench not connecting to localhost: How to fix there is no connection to the MySQL Server

Screenshot 2021 02 01 at 12.25.27

MySQL Database (Db) is a database service that runs on a Local Server and on the Web, and it is ideal for both small and large applications and it uses the standard SQL language. MySQL is free to download and use and has the most comprehensive set of advanced features, management tools, and technical support to achieve the highest levels of MySQL scalability, security, reliability, and uptime. The data in a MySQL database are stored in tables. A table is a collection of related data, and it consists of columns and rows, and the Db is useful for storing information categorically. See the following guides on MySQL, how to reset Mysql Root password, how to access MySQL Server from command Prompt, how to create and delete MySQL database, and how to migrate Veeam MsSQL Database to a new MsSQL Server.

Note: It is worth noting that by default, the MySQL server listens for connections only from localhost, which means it can be accessed only by applications running on the same host. But in production environments, you can allow remote access to the MySQL server. In this aspect, you will have to configure the MySQL server to listen on a specific IP address or all IP addresses on the server. This article shows the steps to resolve connection issues to MySQL Server. See how to install Microsoft SQL Server 2019 and MsSQL Command line tools on Ubuntu Linux, how to uninstall Microsoft SQL Server on Windows 10 and Windows Server, and how to download and install Microsoft SQL Server 2019 Developer Edition and Microsoft SQL Server Management Studio on Windows 10 and Windows Server.

Root Cause: This error is shown in because the application was unable to connect to the mysql server. There could be a number of reasons. But in my case, it was because the service was stopped and the service was not running. To fix this issue, kindly follow the steps below.

Launch MySQL Workbench to open the home screen. Existing connections are shown when you click the MySQL Connections view from the sidebar. No connections exist for first-time users.

Click on the Server Menu and click on Startup/Shutdown option as shown below

Accept the UAC.
– Next, you will be required to enter your password in order to start the database server,
– Enter your password and click on OK.

As you can see also the MySQL service is also running and this is all that is needed to resolved this connection issue.

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session. I welcome you to subscribe to my YouTube Channel.

Источник

Устраняем типичные ошибки в MySQL

Авторизуйтесь

Устраняем типичные ошибки в MySQL

MySQL — система управления базами данных (СУБД) с открытым исходным кодом от компании Oracle. Она была разработана и оптимизирована специально для работы веб-приложений. MySQL является неотъемлемой частью таких веб-сервисов, как Facebook, Twitter, Wikipedia, YouTube и многих других.

Эта статья расскажет, как определять, с чем связаны частые ошибки на сервере MySQL, и устранять их.

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

Одной из распространённых ошибок подключения клиента к серверу является «ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)».

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

Эта ошибка означает, что на хосте не запущен сервер MySQL ( mysqld ) или вы указали неправильное имя файла сокета Unix или порт TCP/IP при попытке подключения.

Убедитесь, что сервер работает. Проверьте процесс с именем mysqld на хосте сервера, используя команды ps или grep, как показано ниже.

Если эти команды не показывают выходных данных, то сервер БД не работает. Поэтому клиент не может подключиться к нему. Чтобы запустить сервер, выполните команду systemctl.

Чтобы проверить состояние службы MySQL, используйте следующую команду:

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

Если в результате выполнения команды произошла ошибка службы MySQL, вы можете попробовать перезапустить службу и ещё раз проверить её состояние.

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

Если сервер работает (как показано) и вы по-прежнему видите эту ошибку, вам следует проверить, не заблокирован ли порт TCP/IP брандмауэром или любой другой службой блокировки портов.

Не удаётся подключиться к серверу MySQL

Ещё одна похожая и часто встречающаяся ошибка подключения — «(2003) Can’t connect to MySQL server on ‘server’ (10061)». Это означает, что в сетевом соединении было отказано.

Следует проверить, работает ли в системе сервер MySQL (смотрите выше) и на тот ли порт вы подключаетесь (как найти порт, можно посмотреть выше).

Похожие частые ошибки, с которыми вы можете столкнуться при попытке подключиться к серверу MySQL:

Ошибки запрета доступа в MySQL

В MySQL учётная запись (УЗ) определяется именем пользователя и клиентским хостом, с которого пользователь может подключиться. УЗ может также иметь данные для аутентификации (например, пароль).

Причин для запрета доступа может быть много. Одна из них связана с учётными записями MySQL, которые сервер разрешает использовать клиентским программам при подключении. Это означает, что имя пользователя, указанное в соединении, может не иметь прав доступа к базе данных.

В MySQL есть возможность создавать учётные записи, позволяющие пользователям клиентских программ подключаться к серверу и получать доступ к данным. Поэтому при ошибке доступа проверьте разрешение УЗ на подключение к серверу через клиентскую программу.

Увидеть разрешённые привилегии учётной записи можно, выполнив в консоли команду SHOW GRANTS
Входим в консоль (пример для Unix, для Windows консоль можно найти в стартовом меню):

В консоли вводим команду:

Дать привилегии конкретному пользователю в БД по IP-адресу можно, используя следующие команды:

Ошибки запрещённого доступа могут также возникнуть из-за проблем с подключением к MySQL (см. выше).

Потеря соединения с сервером MySQL

С этой ошибкой можно столкнуться по одной из следующих причин:

В первом случае убедитесь, что у вас стабильное сетевое подключение (особенно, если подключаетесь удалённо).

В случае с размером BLOB нужно установить более высокое значение для max_allowed_packet в файле конфигурации /etc/my.cnf в разделах [mysqld] или [client] как показано ниже.

Если файл конфигурации недоступен, это значение можно установить с помощью следующей команды.

Слишком много подключений

Недостаточно памяти

Если такая ошибка возникла, это может означать, что в MySQL недостаточно памяти для хранения всего результата запроса.

Сначала нужно убедиться, что запрос правильный. Если это так, то нужно выполнить одно из следующих действий:

Также может помочь MySQL Tuner. Это полезный скрипт, который подключается к работающему серверу MySQL и даёт рекомендации по настройке для более высокой производительности.

MySQL продолжает «падать»

Если такая проблема возникает, необходимо выяснить, заключается она в сервере или в клиенте. Обратите внимание, что многие сбои сервера вызваны повреждёнными файлами данных или индексными файлами.

Вы можете проверить состояние сервера, чтобы определить, как долго он работал.

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

Кроме того, можно остановить сервер, сделать отладку MySQL и снова запустить службу. Для отображения статистики процессов MySQL во время выполнения других процессов откройте окно командной строки и введите следующее:

Заключение

Самое важное при диагностике — понять, что именно вызвало ошибку. Следующие шаги помогут вам в этом:

Источник

Не удается подключиться к серверу базы данных (mysql workbench)

Не могли бы вы помочь мне решить эту проблему?

Когда я пытаюсь щелкнуть «базу данных запросов» в меню базы данных в Workbench Mysql. это дает мне ошибку:

ОТВЕТЫ

Ответ 1

Вероятно, проблема связана с тем, что аутентификация сокета включена для пользователя root по умолчанию, когда пароль не задан, во время обновления до ubuntu 16.04.

Решение состоит в том, чтобы вернуться к аутентификации собственного пароля. Вы можете сделать это, войдя в MySQL, используя проверку сокетов, выполнив:

После входа в систему:

который вернется к исходной (старой по умолчанию) аутентификации пароля.

Теперь используйте пароль в качестве пароля, когда это требуется MySQL.

Ответ 2

Попробуйте открыть services.msc из окна поиска в меню «Пуск» и попробуйте вручную запустить службу MySQL.

Ответ 3

Похоже, есть много причин этой ошибки.

Моя причина/решение

Это позволяет устанавливать соединения с любого IP, а не только с 127.0.0.1.

Затем я создал пользователя MySql, который мог подключиться с моего клиентского компьютера, выполнив следующие команды терминала:

Другие причины

Ответ 4

Вы пытались определить, является ли это проблемой с Workbench или общей проблемой соединения? Попробуйте следующее:

Сообщите, как это сработало.

Ответ 5

У меня была похожая проблема в Mac OS, и я смог ее исправить следующим образом:

Из терминала запустите:

Затем меня попросили ввести пароль. Я просто нажал Enter, так как пароль не был установлен.

Я получил сообщение следующим образом:

Если вам удалось войти в mysql>, выполните следующую команду:

Вы должны получить сообщение, подобное этому:

Запрос в порядке, затронуто 0 строк (0,19 с)

Ответ 6

Мне пришлось запустить Workbench в качестве администратора. По-видимому, у него не было необходимых разрешений для подключения к процессу сервера базы данных localhost.

Ответ 7

Я некоторое время боролся с этой проблемой и делал несколько переустановок MySQL, прежде чем обнаруживать это.

Я знаю, что сервер MySQL работал нормально, потому что я мог получить доступ ко всей моей БД с помощью командной строки.

Надеюсь, это сработает для вас.

В MySQL Workbench (5.2.47 CE)

нажмите Экземпляры сервера Mange (нижний правый угол)

нажмите Соединение

в поле Соединение выберите:

нажмите Изменить выбранные.

под Параметры, Имя хоста измените localhost или 127.0.0.1 на имя NetBIOS

нажмите Проверить соединение

Если это сработает для вас, отлично. Если имя хоста не изменилось, то оно было.

Ответ 8

Ошибка возникает из-за того, что сервер mysql не запускается на вашем компьютере. Вы должны запустить его вручную. Выполните следующие действия:

Загрузите и установите сервер Wamp в соответствии со своей битовой версией (32 бит или 64 бит) на вашем компьютере (http://wampserver-64bit.en.softonic.com/). позволяет загружать сервер Wamp на 64-разрядный.

Как только вы его установили, вы можете дважды щелкнуть и запустить его.. (вы можете увидеть значок в правой руке панели задач. Возможно, он скрыт. Вы можете щелкнуть стрелку, которая показывает вам скрыть запуск приложений). Нажмите на значок и перейдите в Mysql

Затем перейдите в Сервис, и там вы можете найти Начать/возобновлять службы.

И теперь это делается. Откройте рабочий стол mysql и увидите. Он будет работать.

Ответ 9

Запустите команду ALTER USER. Обязательно смените пароль на надежный пароль по вашему выбору.

sudo mysql # Войдите в MySQL

Запустите приведенную ниже команду

Теперь вы можете получить к нему доступ, используя новый пароль.

Ответ 10

Чтобы быть в курсе последних версий и более поздних посетителей:

В настоящее время я работаю над win7 64bit с различными инструментами, включая python 2.7.4, как необходимое условие для google android.

Когда я обновил с WB 6.0.8-win32 до верхних версий, чтобы иметь 64-битную производительность, у меня были некоторые проблемы, например, на 6.3.5-winx64. У меня была ошибка в представлении деталей таблиц (неупорядоченное представление), что привело к понижению до 6.2.5-winx64.

Заключение: Таким образом, иногда проблемы с подключением db в workbench могут быть связаны с самим собой, а не с сервером (если у вас нет других проблем с подключением к db).

Ответ 11

Причина была в том, что я пытался использовать новейший MySQL Workbench 8.x для подключения к MySQL Server 5.1 (оба работают на Windows Server 2012).

Когда я удалил MySQL Workbench 8.x и установил MySQL Workbench 6.3.10, он успешно подключился к базе данных localhost

Ответ 12

Я тоже долгое время боролся с этой проблемой.

Я также набрал (очевидно) некоторый хороший SO Q/A.

Похоже, что сообщение, упомянутое в вопросе «user948950», может исходить из широкого круга причин: слишком большой файл журнала, неправильные значения файла mysql.ini, пробелы в пути к файлу, проблема безопасности /acl, старые записи в реестр и т.д.

Итак, после попытки за 3 часа исправить это. Я отказался и решил сделать старую старую переустановку.

Гэри Уильямс писал (а): Привет, ребята,

У меня была точно такая же проблема, и вот как я ее работаю для меня, начиная с нерабочей установки.

Остановите службу Windows для любой существующей установки mysql.

Теперь стоит запустить regedit, чтобы удалить старые записи реестра, а также удалить. Если нет, удалите их.

Не используйте свой путь установки по умолчанию! Некоторые гении устанавливают путь с пробелами в нем! Выберите пользовательскую установку и выберите разумный путь, т.е. C:\mysql (примечание от Adrien: C:\mysqldata для. данных)

Не следует изменять параметры безопасности. Снимите флажок в соответствующем поле, и установка завершится без установки root пароль.

Думаю, я все вспомнил.

Я столкнулся с проблемами, когда просто копировал/вставлял базы данных, которые у меня были в предыдущем каталоге данных, в новый. Поэтому работа, которую я нашел, заключалась в том, чтобы экспортировать каждую базу данных (я знаю. много веселья), а затем повторно импортировать их по одному.

Ответ 13

Я был в подобных ситуациях до и в прошлый раз, когда обнаружил, что это проблема с выпуском Windows (не уверен). На этот раз я открыл Workbench MySQL и не нашел подключения к моей локальной базе данных. Я не вижу свои таблицы, но вчера я мог подключиться к базе данных.

Я обнаружил, что моя причина в том, что после того, как мой компьютер снова сработает и снова проснется, служба mysql не работает. Мое решение: перезапустите службу с именем «mysql» и перезапустите верстак. Перезапуск службы занимает некоторое время, но он работает.

Ответ 14

Моя проблема заключалась в том, что сервер MySQL фактически не был установлен. Я запустил MySQL Installer, но он не установил сервер MySQL.

Я перезапущу установщика, нажмите «Добавить», а затем добавил сервер MySQL в список. Теперь он отлично работает.

Ответ 15

В моем случае я только что установил MySQL Workbench, но после удаления MySQL Workbench и установки установщика MySQL он одинаков как для 32-разрядных, так и для 64-разрядных, после чего он работает как чудо. Надеюсь, это может быть полезно.

Источник

Cannot connect to Database server (mysql workbench)

When I try to click «query database» under database menu in Mysql workbench. it gives me an error:

Cannot Connect to Database Server

Your connection attempt failed for user ‘root’ from your host to server at 127.0.0.1:3306:Can’t connect to mysql server on ‘127.0.0.1’(10061)

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

22 Answers 22

The issue is likely due to socket authentication being enabled for the root user by default when no password is set, during the upgrade to ubuntu 16.04.

The solution is to revert back to native password authentication. You can do this by logging in to MySQL using socket authentication by doing:

which will revert back to the native (old default) password authentication.

Now use password as the password whenever required by MySQL.

Try opening services.msc from the start menu search box and try manually starting the MySQL service or directly write services.msc in Run box

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

It looks like there are a lot of causes of this error.

My Cause / Solution

In my case, the cause was that my server was configured to only accept connections from localhost. I fixed it by following this article: How Do I Enable Remote Access To MySQL Database Server?. My my.cnf file had no skip-networking line, so I just changed the line

This allows connections from any IP, not just 127.0.0.1.

Then, I created a MySql user that could connect from my client machine by running the following terminal commands:

where 1.2.3.4 is the IP of the client you are trying to connect from. If you really have trouble, you can use ‘%’ instead of ‘1.2.3.4’ to allow the user to connect from any IP.

Other Causes

For a fairly extensive list, see Causes of Access-Denied Errors.

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

Did you try to determine if this is a problem with Workbench or a general connection problem? Try this:

Report back how this worked.

I had a similar issue on Mac OS and I was able to fix it this way:

From the terminal, run:

Then, I was asked to enter the password. I just pressed enter since no password was setup.

I got a message as follows:

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 181. Server version: 8.0.11 Homebrew.

If you succeeded to log into mysql>, run the following command:

You should get a message like this:

Query OK, 0 rows affected (0.19 sec)

Now, your password is «password» and your username is «root«.

Run the ALTER USER command. Be sure to change password to a strong password of your choosing.

sudo mysql # Login to mysql`

Run the below command

Now you can access it by using the new password.

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

I had to start Workbench as Administrator. Apparently it didn’t have the required permissions to connect to my localhost database server process.

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

The error occur because the mysql server is not starting on your computer. You should start it manually. Do following steps:

Download and install wamp server according to your bit version(32bit or 64bit) in your computer(http://wampserver-64bit.en.softonic.com/) this link allows you to download wamp server for 64bit.

Then go to Service and there you can find Start/Resume Services click on it..

And now it is done.Open mysql workbench and see.It will work..

I struggled with this problem for awhile and did several reinstalls of MySQL before discovering this.

I know that MySQL server was running OK because I could access all my DB’s using the command line.

Hope this works for you.

In MySQL Workbench (5.2.47 CE)

click Mange Server Instances (bottom right corner)

click Connection

in the Connection box select:

click Edit Selected.

under Parameters, Hostname change localhost or 127.0.0.1 to your NetBIOS name

click Test Connection

If this works for you, great. If not change the hostname back to what it was.

Forr me reason was that I tried to use newest MySQL Workbench 8.x to connect to MySQL Server 5.1 (both running on Windows Server 2012).

When I uninstalled MySQL Workbench 8.x and installed MySQL Workbench 6.3.10 it successfully connected to localhost database

no connection established mysql workbench что делать. Смотреть фото no connection established mysql workbench что делать. Смотреть картинку no connection established mysql workbench что делать. Картинка про no connection established mysql workbench что делать. Фото no connection established mysql workbench что делать

For those who ignored that the initial error message displaying is the following one:

Make sure to install gnome-keyring using the following

To be up to date for upper versions and later visitors :

When I upgraded from WB 6.0.8-win32 to upper versions to have 64bit performance I had some problems for example on 6.3.5-winx64 I had a bug in the details view of tables (disordered view) caused me to downgrade to 6.2.5-winx64.

As a GUI user, easy forward/backward engineering and db server relative items were working well but when we try to Database>Connect to Database we will have Not connected and will have python error if we try to execute a query however the DB server service is absolutely ran and is working well and this problem is not from the server and is from workbench. To resolve it we must use Query>Reconnect to Server to choose the DB connection explicitly and then almost everything looks good (this may be due to my multiple db connections and I couldn’t find some solution to define the default db connection in workbench).

As a note : because I’m using latest Xampp version (even in linux addictively 🙂 ), recently Xampp uses mariadb 10 instead of mysql 5.x causes the mysql file version to be 10 may cause some problems such as forward engineering of procedures which can be resolved via mysql_upgrade.exe but still when we try to check a db connection wb will inform about the wrong version however it is not critical and works well.

Conclusion : Thus sometimes db connection problems in workbench may be due to itself and not server (if you don’t have other db connection relative problems).

Источник

No connection established mysql workbench что делать

The error (2003) Can’t connect to MySQL server on ‘ server ‘ (10061) indicates that the network connection has been refused. You should check that there is a MySQL server running, that it has network connections enabled, and that the network port you specified is the one configured on the server.

Check to make sure that there is no firewall blocking access to MySQL. Your firewall may be configured on the basis of the application being executed, or the port number used by MySQL for communication (3306 by default). Under Linux or Unix, check your IP tables (or similar) configuration to ensure that the port has not been blocked. Under Windows, applications such as ZoneAlarm or Windows Firewall may need to be configured not to block the MySQL port.

Here are some reasons the Can’t connect to local MySQL server error might occur:

You’re running a MySQL server on Windows with many TCP/IP connections to it. If you’re experiencing that quite often your clients get that error, you can find a workaround here: Section B.3.2.2.1, “Connection to MySQL Server Failing on Windows”.

If you are running under Linux and Security-Enhanced Linux (SELinux) is enabled, see Section 6.7, “SELinux”.

B.3.2.2.1 Connection to MySQL Server Failing on Windows

When you’re running a MySQL server on Windows with many TCP/IP connections to it, and you’re experiencing that quite often your clients get a Can’t connect to MySQL server error, the reason might be that Windows does not allow for enough ephemeral (short-lived) ports to serve those connections.

The purpose of TIME_WAIT is to keep a connection accepting packets even after the connection has been closed. This is because Internet routing can cause a packet to take a slow route to its destination and it may arrive after both sides have agreed to close. If the port is in use for a new connection, that packet from the old connection could break the protocol or compromise personal information from the original connection. The TIME_WAIT delay prevents this by ensuring that the port cannot be reused until after some time has been permitted for those delayed packets to arrive.

It is safe to reduce TIME_WAIT greatly on LAN connections because there is little chance of packets arriving at very long delays, as they could through the Internet with its comparatively large distances and latencies.

Windows permits ephemeral (short-lived) TCP ports to the user. After any port is closed, it remains in a TIME_WAIT status for 120 seconds. The port is not available again until this time expires. The default range of port numbers depends on the version of Windows, with a more limited number of ports in older versions:

Windows through Server 2003: Ports in range 1025–5000

Windows Vista, Server 2008, and newer: Ports in range 49152–65535

With a small stack of available TCP ports (5000) and a high number of TCP ports being open and closed over a short period of time along with the TIME_WAIT status you have a good chance for running out of ports. There are two ways to address this problem:

Reduce the number of TCP ports consumed quickly by investigating connection pooling or persistent connections where possible

Tune some settings in the Windows registry (see below)

The following procedure involves modifying the Windows registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore it if a problem occurs. For information about how to back up, restore, and edit the registry, view the following article in the Microsoft Knowledge Base: http://support.microsoft.com/kb/256986/EN-US/.

Start Registry Editor ( Regedt32.exe ).

Locate the following key in the registry:

This sets the number of ephemeral ports available to any user. The valid range is between 5000 and 65534 (decimal). The default value is 0x1388 (5000 decimal).

This sets the number of seconds to hold a TCP port connection in TIME_WAIT state before closing. The valid range is between 30 and 300 decimal, although you may wish to check with Microsoft for the latest permitted values. The default value is 0x78 (120 decimal).

Quit Registry Editor.

Reboot the machine.

Note: Undoing the above should be as simple as deleting the registry entries you’ve created.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *