Ошибка «Сервер MySQL исчез»: как исправить сообщение об ошибке
Видео по теме: (September 2024).
Ошибка MySQL 2006 «Сервер MySQL исчез» снова и снова, особенно при импорте баз данных в MySQL. Существует простое решение ошибки. Вы можете найти обзор всех шагов здесь.
Просто исправьте MySQL Error 2006 "Сервер MySQL ушел"
Эта ошибка MySQL возникает при импорте баз данных, которые слишком велики или соединение слишком медленное для загрузки. Чтобы исправить ошибку, просто измените две переменные в файле конфигурации MySQL.
- Под XAMPP в Windows вы найдете файл конфигурации в C: \ xampp \ mysql \ bin \ my.cnf по умолчанию
- Если этот файл не существует, вы можете просто использовать
Щелкните правой кнопкой мыши> «Создать»> Создать «Текстовый документ». - Другой практический совет расскажет вам, как сохранить файл с новым расширением (.cnf).
- В Linux этот файл по умолчанию находится в /etc/mysql/my.cnf
В этом файле вы теперь вводите более высокие значения для следующих переменных:
- wait_timeout = 60 Здесь вы вводите желаемое время ожидания в секундах - если оно все еще слишком мало, вы можете просто увеличить его еще больше.
- max_allowed_packet = 100M Эта переменная определяет максимальный размер пакета для загрузки.
Теперь установите значение этой переменной вверх, чтобы оно было больше, чем размер файла базы данных, которая будет импортирована. - Наконец перезапустите MySQL - ошибка больше не должна возникать
- Важно: в реальных системах вы должны сбросить измененные переменные к их значениям по умолчанию, поскольку они могут представлять собой дыру в безопасности для злоумышленников.
В следующей статье мы покажем вам, как работает импорт баз данных в MySQL с помощью инструмента phpMyAdmin.