failed to start lsb mysql

После выполнения инструкций в этом сообщении о том, как установить MySQL 5.6 поверх существующей установки 5.7 на Ubuntu 16.04, я имел несколько проблем с запуском службы.

Сначала это произошло:

Что было решено, запустив systemctl unmask mysql.service . Однако затем я неоднократно получал это сообщение:

Проверка systemctl status mysql.service показала:

2 ответа

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

Во-первых, journalctl -xe содержит намного больше информации. В моем случае он содержал:

Это можно исправить с помощью vi /etc/apparmor.d/usr.sbin.mysqld и добавления строк для:

Интересным моментом является то, что ему нужна отдельная строка для каталога и файлов подстановочных знаков внутри него — это может быть распространено для некоторых приложений unix, но не для всех, поэтому может вас пошевелить.

После того, как все изменения apparmor были выполнены, система все равно не запустилась, и на этот раз команда journalctl -xe ничего не принесла.

Затем я смог запустить sudo -u mysql mysqld , чтобы попытаться запустить демон вручную. Это показало неудачу при запуске InnoDB, но не почему.

По прихоти я удалил файлы /var/lib/mysql/ib_logfile* и ib_binlog и попробовал еще раз; на этот раз сервер запустился. Затем я смог завершить это и запустить service start mysql , который работал.

Отдельно я удалил /var/lib/mysql/debian-5.7.flag — я не уверен, что это помогло или вызвало бы последующие проблемы, если бы я этого не сделал.

Надеюсь, этот пример помогает кому-то; не стесняйтесь добавлять другие ответы вдоль подобной строки, если вы столкнулись с различными проблемами с этим процессом.

So this happened after a reboot

2 Answers 2

Well for some reason mysqld_safe is missing. No idea where it went.

Читайте также:  lb59a mb 12209 1 схема

I simply apt-get remove —> install —> mysql_secure_installation and problem is gone.

To check for details about the error, run:

For more details about the error, check logs:

To initialize the MySQL configuration, run:

Not the answer you’re looking for? Browse other questions tagged mariadb or ask your own question.

Hot Network Questions

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 4.0 with attribution required. rev 2019.11.15.35459

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Are you new to LinuxQuestions.org? Visit the following links:
Site Howto | Site FAQ | Sitemap | Register Now

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux — A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author’s experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Click Here to receive this Complete Guide absolutely free.

At a bit of a loss here. Upgraded to Ubuntu 16.04 from 14.04 in December, which included the change from mysql to mariadb. That hosed a bunch of stuff (upgrade of the database went badly), so I ended up uninstalling both mysql and mariadb, reinstalling, and there was much joy.

The database there is primarily used for mythtv, so I set that up brand new with the new database, and again, there was much joy. The server has been restarted a couple times between then and now.

About ten days ago, I went in and redid some mythtv-setup to add a new channel to the lineup. The setup didn’t exit cleanly, but it restarted the mythtv-backend and everything seemed happy.

Suddenly today, we noticed we stopped getting live TV. Investigate and find it’s because mysql isn’t running. The single line in any mysql log is this:

170210 19:01:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

Ok . so it appears mysql died yesterday. But I go to restart and nothing works.

journalctl -xe reports:

Similarly, systemctl status mysql.service returns:

I only have a single my.cnf file (located in /etc/mysql/my.cnf) and there don’t appear to be any strange items in there. There’s also nothing added to /var/log/mysql/error.log (the only file in that directory) when using any of:
service mysql start
systemctl start mysql
/etc/init.d/mysql start

I know systemctl is the new right way, but tried the others as well in the hope that something might work . same result all the time. Complaining about the socket not being there so nothing can talk to anything, but of course the socket isn’t there while it’s not running.

Somewhat interestingly, I can start the service with:
sudo mysqld —basedir=/usr —datadir=/var/lib/mysql —user=mysql —socket=/var/run/mysqld/mysqld.sock

And of course the socket and pid lock all show up fine this way (this is also where the socket is declared to be in my.cnf)

But then I get a bunch of very strange errors in the log file. All kinds of stuff about what appear to be odd definitions in tables. Things like:

And all kinds of others. Seems weird, but it starts up just fine and I can log into mysql as root and poke around. I can use mysqladmin to shut it down at that point and that happens gracefully.

So currently I’m at a loss. Not sure why it won’t start because I can’t find anything in a log to point to why it won’t start, no pid lock exists (no files are in /var/run/mysqld and that directory is owned by mysql as is /var/lib/mysql).

This issue is persistent across a reboot as well. Not sure where to go next. Guess at least it waited till /after/ the superbowl to die.

For completeness, I also looked in the mythtv logs, but there’s no logs for it that say anything interesting other than unable to connect through socket to mysql, so it’s off.

I’d guess mythtv somehow hosed mysql on exiting badly, but it didn’t matter until mysql completely died. Not sure how to fix this at this point.

Any thoughts / help much appreciated.

Edit: I should also note that no mysql sockets exist when checking either «sudo find / -type s» or «sudo netstat -tln | grep 3306»

Оцените статью
Добавить комментарий

Adblock detector
02-10-2017, 10:32 PM #1