Job for mysql service failed because the control process exited with error code

How fix permanently: Job for mysql.service failed because the control process exited with error code I am working with Ubuntu 18.04 and MySQL Server — 8.0.18 Suddenly today MySQL can’t start anymore With the sudo service mysql status command appears: With the sudo service mysql restart command appears: Following and executing the two suggested […]

Содержание

  1. How fix permanently: Job for mysql.service failed because the control process exited with error code
  2. MySQL not starting due to errors
  3. 3 Answers 3
  4. mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
  5. Ошибка запуска Job for mysql.service failed
  6. Решение проблемы mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
  7. mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
  8. Ошибка запуска Job for mysql.service failed
  9. Решение проблемы mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
  10. Failing to start mysql.service for MySQL 5.6 on Ubuntu 16.04
  11. 3 Answers 3

How fix permanently: Job for mysql.service failed because the control process exited with error code

I am working with Ubuntu 18.04 and MySQL Server — 8.0.18

Suddenly today MySQL can’t start anymore

With the sudo service mysql status command appears:

With the sudo service mysql restart command appears:

Following and executing the two suggested commands:

  • systemctl status mysql.service
  • journalctl -xe

Therefore: sudo systemctl status mysql.service

And with journalctl -xe

I followed the solution about this post:

I used the innodb_force_recovery = 10 (ten), it playing, because with 1 and 2 did not work

Therefore with the sudo systemctl start mysql command is possible start the server. I can see all the data and users saved in peace.

Now through the sudo systemctl status mysql command I get

Until this point would has no sense this post, but if I do either Alpha or Beta steps:

the same problem happens again.

Therefore now is mandatory keep the innodb_force_recovery = 10 , otherwise it returns to the same problem

Warning:

The correct range is from 1 to 6, I am assuming 10 is «interpreted» how the maximum value (6)

Is there a way to configure something and remove innodb_force_recovery ? It to return to the normal or old configuration where all worked fine (without innodb_force_recovery )

Note the final content of /var/log/mysql/error.log is

I am working with VirtualBox — Ubuntu is a guest. It had been working for more of 3 months, now suddenly this situation appeared.

More Info:

One

As requested desertangels

Two

Executing cat /etc/mysql/mysql.conf.d/mysqld.cnf

Three

BTW: just in case, with mysql -u root -p appears:

Источник

MySQL not starting due to errors

I’m trying to get MySQL to work on my ubuntu server. It seems I ran into some errors and I’ve been trying to sort them out myself but I haven’t had any success. I ran:

After the installation I tried to make sure it was turned on by doing sudo service mysql start which ended up in it saying

Job for mysql.service failed because the control process exited with error code. See «systemctl status mysql.service» and «journalctl -xe» for details.

I ran sudo service mysql status Which returned this:

If someone could help with this I would appreciate it.

Here is the output of journalctl -xe after trying to start MySql:

I put it all into hastebin so the gazillion lines can actually fit into there :p

I went by the steps and during the re-install I noted these:

AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open ‘abstractions/mysql’.

E: Sub-process /usr/bin/dpkg returned an error code (1)

W: Operation was interrupted before it could finish.

Output of MySQL Install Command:

Output of sudo apt -o Dpkg::Options::=»—force-confmiss» install —reinstall mysql-server :

3 Answers 3

As described here after installing mysql-server using:

You should configure mysql:

Afterwards tests your configuration using:

If MySQL isn’t running, you can start it with sudo systemctl mysql start .

For an additional check, you can try connecting to the database using the mysqladmin tool, which is a client that lets you run administrative commands. For example, this command says to connect to MySQL as root (-u root), prompt for a password (-p), and return the version.

Firstly, you want to stop using the service structure and start getting used to systemctl structure instead

Secondly, systemd can give you some better information if you check the logging via its tool journalctl :

This should give you more information about what happened. The «status» will not necessarily tell you the events leading to the error.

The problem with starting the server was a protection by Apparmor to protect against unauthorized applications running.

This remedied by added the command line:

Other important components were ensuring against conflicts from the installed mysql-server, but purging it and reinstalling it. Ensuring the defaults are set by removing what’s failing and reinstalling what’s tested from the repository, which works.

During the process of the reinstall (in this case) there was a problem with the perl script which is part of the install routine. Fixing those problems and errors assisted in the reinstall.

The details of the issues that were causing problems were presented at to the concole of which, removing each of the issues was a step by step recovery.

Источник

mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Ошибка запуска Job for mysql.service failed

Если у вас упала база данных MySQL и при запуске «service mysql restart» пишет такую ошибку:

Job for mysql.service failed because the control process exited with error code. See «systemctl status mysql.service» and «journalctl -xe» for details.

При выполнении команды

мы выдим такую строку:

mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Решение проблемы mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Добавляем в файл конфигурации /etc/mysql/my.cnf (в зависимости от вашей конфигурации my.cnf и ОС может иметь другое местоположение) строку:

Сохраняем файл my.cnf и выполняем команду:

Если это не сработало, то нужно увеличить число «innodb_force_recovery = 2» или 3, и снова запустить обновления конфигурации «sudo systemctl start mysql».

После успешного выполнения нужно закомментировать строку innodb_force_recovery и перезагрузиться (некоторые операции не разрешены в режиме принудительного восстановления).

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

Источник

mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Ошибка запуска Job for mysql.service failed

Если у вас упала база данных MySQL и при запуске «service mysql restart» пишет такую ошибку:

Job for mysql.service failed because the control process exited with error code. See «systemctl status mysql.service» and «journalctl -xe» for details.

При выполнении команды

мы выдим такую строку:

mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Решение проблемы mysql.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Добавляем в файл конфигурации /etc/mysql/my.cnf (в зависимости от вашей конфигурации my.cnf и ОС может иметь другое местоположение) строку:

Сохраняем файл my.cnf и выполняем команду:

Если это не сработало, то нужно увеличить число «innodb_force_recovery = 2» или 3, и снова запустить обновления конфигурации «sudo systemctl start mysql».

После успешного выполнения нужно закомментировать строку innodb_force_recovery и перезагрузиться (некоторые операции не разрешены в режиме принудительного восстановления).

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

Источник

Failing to start mysql.service for MySQL 5.6 on Ubuntu 16.04

After following the instructions in this post on how to install MySQL 5.6 over an existing 5.7 installation on Ubuntu 16.04 I had multiple problems starting the service.

First this happened:

Which was solved by running systemctl unmask mysql.service . However then I repeatedly had this message:

Inspecting systemctl status mysql.service showed:

3 Answers 3

After Downgrading MySQL version I am also facing this try following command

The fix for this contained multiple steps including different debug logs and then following clues in those logs. I’m documenting them to help others — your problems might be different but this process should help to discover what’s wrong:

Firstly journalctl -xe contains a lot more information. In my case it contained:

This could be fixed with vi /etc/apparmor.d/usr.sbin.mysqld and adding lines for:

An interesting point is that it needs a separate line for a directory and wildcard files within it — this can be common for some unix applications but not all so might trip you up.

Once all the apparmor changes were done the system still wouldn’t start, and this time the journalctl -xe command yielded nothing useful.

I was then able to run sudo -u mysql mysqld to try starting the daemon manually. This showed a failure with InnoDB starting up, but not why.

On a whim I deleted the files /var/lib/mysql/ib_logfile* and ib_binlog and tried again; this time the server started. I was then able to terminate this and run service start mysql which worked.

Separately I deleted /var/lib/mysql/debian-5.7.flag — I am unsure if this helped or would have caused subsequent problems if I had not done so.

Hopefully this example helps somebody; please feel free to add other answers along a similar line if you encountered different problems with this process.

Источник

Problem

When trying to start MySQL using systemctl fails to start, for example:

# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
# systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

Solution

There can be multiple causes for this. Some (but not limited to) examples are:

  • A typo in a configuration option in the MySQL configuration file.
  • Presence of a no longer used option in the MySQL configuration file.
  • Wrong file system level permission.

To investigate what error is causing MySQL not to start, there are several sources that can be used:

1. The MySQL error log

By default this is located in /var/log/mysqld.log but may be in a different location if the log-error option is set in the MySQL configuration file. This is the best place to start, however depending on the error, the startup process may not even have gotten far enough to write to the MySQL error log.

2. Check the output of “systemctl status mysqld”

The output of “systemctl status mysqld” can also be helpful to identify the cause of the failure.

# systemctl status mysqld

3. The systemd journal

The systemd journal can help to get to the root cause of failure. You can for example browse it interactively using:

If you need to get the journal to be uploded to get it anlyzed by vendor, you need to determine where it is located. This is system specific. For example with the default configuration, the journal on CentOS/RHEL 7 can be found in a subdirectory below /run/log/journal/, for example /run/log/journal/1ffd55f216ea46bd82d0f144065cc29b/system.journal. Another location may be /var/log/journal.

Or you can export the journal like:

# journalctl > journal.log

Once the error message has been determined, use that to investigate the root cause.

#
2 года, 5 месяцев назад

(отредактировано

2 года, 5 месяцев назад)

ForumLiker avatar

Темы:

48

Сообщения:

644

Участник с: 29 марта 2015

Всем доброго настроения. Установил из AUR пакет mysql 8.0.21 с ним установился mysql-clients 8.0.21 и libmysqlclient 8.0.21. Запускаю mysqld.service, получаю

Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xe" for details.

status mysqld.service


● mysqld.service - MySQL Server
     Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sun 2020-08-23 15:21:17 MSK; 36s ago
       Docs: man:mysqld(8)
             http://dev.mysql.com/doc/refman/en/using-systemd.html
    Process: 2891 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
    Process: 2913 ExecStart=/usr/bin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
   Main PID: 2913 (code=exited, status=1/FAILURE)
     Status: "Server startup in progress"

авг 23 15:21:15 arch-pc mysqld[2913]: 2020-08-23T12:21:15.761216Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
авг 23 15:21:15 arch-pc mysqld[2913]: 2020-08-23T12:21:15.762328Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
авг 23 15:21:15 arch-pc mysqld[2913]: 2020-08-23T12:21:15.762552Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending >
авг 23 15:21:15 arch-pc mysqld[2913]: 2020-08-23T12:21:15.762682Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sendin>
авг 23 15:21:15 arch-pc mysqld[2913]: 2020-08-23T12:21:15.762851Z 0 [ERROR] [MY-000067] [Server] unknown variable 'mysql_port=3306'.
авг 23 15:21:15 arch-pc mysqld[2913]: 2020-08-23T12:21:15.763130Z 0 [ERROR] [MY-010119] [Server] Aborting
авг 23 15:21:17 arch-pc mysqld[2913]: 2020-08-23T12:21:17.247809Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: Shutdown complete (mysqld 8.0.21)  Source distribution.
авг 23 15:21:17 arch-pc systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
авг 23 15:21:17 arch-pc systemd[1]: mysqld.service: Failed with result 'exit-code'.
авг 23 15:21:17 arch-pc systemd[1]: Failed to start MySQL Server.

так же отсутствует сокет, без которого видимо и не хочет стартовать

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/run/mysqld/mysqld.sock' exists!

Не могу выполнить инициализацию по причине отсутствия пакета mysql_install_db
И как установить mysql-server? В вики сказано, что Арч теперь дружит с MariaDB и поэтому MySQL переехал в AUR, а вот мануалы по установки на различных сайтах так и остались с командами установки из репозитория.

vs220

#
2 года, 5 месяцев назад

Темы:

22

Сообщения:

8090

Участник с: 16 августа 2009

ForumLiker
дружит с MariaDB

Ну так его и ставьте. Вики по настройке и установке есть

ForumLiker

#
2 года, 5 месяцев назад

ForumLiker avatar

Темы:

48

Сообщения:

644

Участник с: 29 марта 2015

vs220
Ну так его и ставьте

Я с ним не знаком. Читал, что максимально совместим с MySQL. У них что одинаковые базы? Не будет конфликтов при использовании в этих двух СУБД?

nafanja

#
2 года, 5 месяцев назад

(отредактировано

2 года, 5 месяцев назад)

nafanja avatar

Темы:

94

Сообщения:

9252

Участник с: 02 июня 2012

заблокирован

ForumLiker
Я с ним не знаком. Читал, что максимально совместим с MySQL

да это тоже самое.
только тебе зачем нужно?
если для какой то локальной разработки, могу скинуть свой юнит для марии, который можно запускать от пользователя.
как раз и команды, которые нужно выполнить в нем имеются.
ВАНГУЮ, базу не создал.

Псевдографический инсталлятор Arch Linux ver. 3.8.2
Благодарности принимаются на ЯД 410012815723874

ForumLiker

#
2 года, 5 месяцев назад

ForumLiker avatar

Темы:

48

Сообщения:

644

Участник с: 29 марта 2015

nafanja, База у меня есть в Access, частично перенес ее на MySQL на Windows. Каждый раз переключаться не удобно, вот и хотел на Arch установить мускул. В дальнейшем сделаю либо WEB морду либо отдельное приложение для доступа к базе через локальную сеть.

nafanja

#
2 года, 5 месяцев назад

(отредактировано

2 года, 5 месяцев назад)

nafanja avatar

Темы:

94

Сообщения:

9252

Участник с: 02 июня 2012

заблокирован

ForumLiker
В дальнейшем сделаю либо WEB морду либо отдельное приложение для доступа к базе через локальную сеть.

есть же phpmyadmin и др. средства, которые делать не нужно… (все совместимо с Марией как клиенты, с файлами БД не уверен.)

Псевдографический инсталлятор Arch Linux ver. 3.8.2
Благодарности принимаются на ЯД 410012815723874

ForumLiker

#
2 года, 5 месяцев назад

ForumLiker avatar

Темы:

48

Сообщения:

644

Участник с: 29 марта 2015

nafanja, Я имел ввиду интерфейс для удобного чтения и заполнения базы. А для настройки и создания есть mysql-workbench, но он не удобен как для меня. Использую HeidiSQL. Под линь установил аналог в виде DBeaver

ForumLiker

#
2 года, 5 месяцев назад

ForumLiker avatar

Темы:

48

Сообщения:

644

Участник с: 29 марта 2015

Снес mysql установил mariadb 10.5.5. Запускаю mysqld.service и получаю

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

Хотя здесь написано, что имена изменились. Но не суть. В вики сказано запустить mariadb.service. Запускаю

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

И вновь в папке /run/mysqld/ нет нужного сокета
Как запустить то??

ForumLiker

#
2 года, 5 месяцев назад

ForumLiker avatar

Темы:

48

Сообщения:

644

Участник с: 29 марта 2015

Все. Разобрался. Удалил папку /var/lib/mysql

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

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

  • Job for isc dhcp server service failed because the control process exited with error code
  • Joomla админка error
  • Job for httpd service failed because the control process exited with error code centos
  • Joomla installation error
  • Job for elasticsearch service failed because the control process exited with error code

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

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