mysql does not restart - mysql

I've tried to restart mysql 5.7 :
service mysql restart
But it fails and i do not understand why :
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
And I dont see what's wrong in the logs :
systemctl status mariadb.service
● mariadb.service - MariaDB 10.1.37 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-02-25 22:02:52 GMT; 1min 9s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 15467 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=127)
Main PID: 28679 (code=exited, status=0/SUCCESS)
Feb 25 22:02:52 stretch systemd[1]: Starting MariaDB 10.1.37 database server...
Feb 25 22:02:52 stretch systemd[1]: mariadb.service: Control process exited, code=exited status=127
Feb 25 22:02:52 stretch systemd[1]: Failed to start MariaDB 10.1.37 database server.
Feb 25 22:02:52 stretch systemd[1]: mariadb.service: Unit entered failed state.
Feb 25 22:02:52 stretch systemd[1]: mariadb.service: Failed with result 'exit-code'.
Any help would be welcome...
I'm on Debian 9, with 1800Mo in ram free.
Here is what the journal says :
journalctl -xe
Feb 26 08:09:01 stretch CRON[16792]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb 26 08:09:01 stretch CRON[16793]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Feb 26 08:09:01 stretch CRON[16792]: pam_unix(cron:session): session closed for user root
Feb 26 08:17:01 stretch CRON[16794]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb 26 08:17:01 stretch CRON[16795]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Feb 26 08:17:01 stretch CRON[16794]: pam_unix(cron:session): session closed for user root
Feb 26 08:25:23 stretch systemd[1]: Starting MariaDB 10.1.37 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit mariadb.service has begun starting up.
Feb 26 08:25:23 stretch systemd[1]: mariadb.service: Control process exited, code=exited status=127
Feb 26 08:25:23 stretch systemd[1]: Failed to start MariaDB 10.1.37 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit mariadb.service has failed.
--
-- The result is failed.
Feb 26 08:25:23 stretch systemd[1]: mariadb.service: Unit entered failed state.
Feb 26 08:25:23 stretch systemd[1]: mariadb.service: Failed with result 'exit-code'.

I also got this error when upgrading to Debian Buster (from MariaDB 10.1 to 10.3). Running mysqld myself and mysql_upgrade both worked anyways. Try executing the following command to restart systemd on the fly. See also https://unix.stackexchange.com/a/419375.
systemctl daemon-reexec
If you don't do this, a reboot will probably fix this as well. Commenting out the ExecStartPre in /etc/systemd/system/mysql.service was not enough as the other ExecStartPre commands then failed instead (also with the exit code 127, i.e. "command not found").

Under Process: is the ExecStartPre returning with an error exist status
Based on error 127, I'd suspect that /usr/bin/install doesn't exist.

Related

Can't start MariaDB on debian 10

I can't seem to be able to start mariadb sql anymore. Internet says a bunch of things but they all seem to be "risky" and it seems that it really depends on the case. So here is mine. I don't know what/when happened but I am afraid to lose my subscribers data. What do you, superheroes, suggest?
When I try to start mariadb :
me#server:# systemctl start 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.
And with systemctl status mariadb.service:
me#server:# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.27 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-12-07 21:04:05 CET; 1min 53s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 13289 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Process: 13290 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 13292 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environm
Process: 13339 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Main PID: 13339 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Dec 07 21:03:59 server systemd[1]: Starting MariaDB 10.3.27 database server...
Dec 07 21:04:01 server mysqld[13339]: 2020-12-07 21:04:01 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 13339 ...
Dec 07 21:04:05 server systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Dec 07 21:04:05 server systemd[1]: mariadb.service: Failed with result 'exit-code'.
Dec 07 21:04:05 server systemd[1]: Failed to start MariaDB 10.3.27 database server.
And when I go to journalctl -xe, I only get:
Dec 07 21:10:04 vps69770 sshd[13784]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=161.35.121.130 user=root
Dec 07 21:10:04 sshd[13712]: Received disconnect from 124.239.216.233 port 59950:11: Bye Bye [preauth]
Dec 07 21:10:04 sshd[13712]: Disconnected from authenticating user root 124.239.216.233 port 59950 [preauth]
Dec 07 21:10:04 sshd[13771]: Failed password for root from 111.201.133.174 port 48444 ssh2
Dec 07 21:10:05 sshd[13771]: Received disconnect from 111.201.133.174 port 48444:11: Bye Bye [preauth]
Dec 07 21:10:05 sshd[13771]: Disconnected from authenticating user root 111.201.133.174 port 48444 [preauth]
Dec 07 21:10:05 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit mariadb.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Dec 07 21:10:05 server systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
Dec 07 21:10:05 server systemd[1]: Failed to start MariaDB 10.3.27 database server.
-- Subject: A start job for unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit mariadb.service has finished with a failure.
--
-- The job identifier is 1241 and the job result is failed.
Dec 07 21:10:06 server sshd[13784]: Failed password for root from 161.35.121.130 port 37142 ssh2
Dec 07 21:10:06 server sshd[13784]: Received disconnect from 161.35.121.130 port 37142:11: Bye Bye [preauth]
Dec 07 21:10:06 server sshd[13784]: Disconnected from authenticating user root 161.35.121.130 port 37142 [preauth]
Which is not a big help
I have no idea what to do. I really don't want to lose my database.
Thanks for your input
Solved it by deleting/renaming the tc.log mv -vi /var/lib/mysql/tc.log /root And restarting the database service mysql restart

MySQL Service dosent start anymore

When i try to start mysql with:
service mysql start
/etc/init.d/mysql start
Then it takes a while and this shows:
[....] Starting mysql (via systemctl): mysql.serviceJob for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
failed!
Now when I go to journalctl -xe it shows:
Feb 18 14:54:43 mail systemd[1]: mariadb.service: Start operation timed out. Terminating.
Feb 18 14:55:24 mail systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Feb 18 14:55:24 mail systemd[1]: Failed to start MariaDB 10.1.37 database server.
Feb 18 14:56:14 mail mysqld[8490]: 2019-02-18 14:56:14 140312205868416 [Note] /usr/sbin/mysqld (mysqld 10.1.37-MariaDB-0+deb9u1) starting as process 8490 ...
Feb 18 14:57:44 mail systemd[1]: mariadb.service: Start operation timed out. Terminating.
Feb 18 14:58:25 mail systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Feb 18 14:58:25 mail systemd[1]: Failed to start MariaDB 10.1.37 database server.
I cant login anymore in root user. Then I start mysql in safemode and change the password.
this error mostly come when you moved from mysql to mariadb. here is the solution you need to run three commands and your application will start working again.
echo "/usr/sbin/mysqld { }" > /etc/apparmor.d/usr.sbin.mysqld
apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld systemctl
restart mariadb

MySQL general_log cannot be enabled. What am I doing wrong?

I'm on Ubuntu 18.04 with MySQL 5.7.24 and I'm trying to enable the general_log as described here.
So in my /etc/mysql/my.cnf I added this:
general_log = on
general_log_file=/tmp/mysql.log
I then stopped and started mysql again, but I get an error:
$ sudo service mysql stop
$ sudo service mysql start
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
So I checked out systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-01-04 17:50:31 CET; 45s ago
Process: 27206 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
Process: 27613 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
Main PID: 27208 (code=exited, status=0/SUCCESS)
Jan 04 17:50:31 librem systemd[1]: mysql.service: Failed with result 'exit-code'.
Jan 04 17:50:31 librem systemd[1]: Failed to start MySQL Community Server.
Jan 04 17:50:31 librem systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Jan 04 17:50:31 librem systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Jan 04 17:50:31 librem systemd[1]: Stopped MySQL Community Server.
Jan 04 17:50:31 librem systemd[1]: mysql.service: Start request repeated too quickly.
Jan 04 17:50:31 librem systemd[1]: mysql.service: Failed with result 'exit-code'.
Jan 04 17:50:31 librem systemd[1]: Failed to start MySQL Community Server.
In journalctl -xe I get pretty much the same.
I tried creating the log file in /tmp/mysql.log and chmodding it to 777, but after doing that, starting up mysql fails with the same errors.
Does anybody know what's wrong here?
In the end I solved it using this tip. Just copy pasting it here for future readers:
SET global log_output = 'FILE';
SET global general_log_file='/var/log/mysql/general.log';
SET global general_log = 1;
No need to restart. The user does need the SUPER privilege (GRANT SUPER ON *.* TO user1#localhost). This works for existing and new connections on the DB and is a global setting so it works for all databases.
It can be turned off with
SET global general_log = 0;

Trouble setting up screen sharing on Fedora 27 Desktop

I'm running Fedora 27 Desktop edition with GNOME. I've tried instructions from all over the web, but haven't found anything that lets me set up sharing my screen with a remote user. Can anyone help me with this?
Thank you very much in advance for your response.
Here's the story so far:
========
I initially tried:
Activies -> Show Application -> Settings -> Sharing
and saw options:
File Sharing
Media Sharing
Remote Login
But saw no option for Screen Sharing, which one page suggested should be present.
========
I've looked at:
https://docs.fedoraproject.org/f27/system-administrators-guide/Wayland.html
and run
$ echo $WAYLAND_DISPLAY
which yields
wayland-0
but I can't find out how to use this information to solve my problem. I also don't find documentation that screen sharing on Wayland under Fedora 27 is working.
========
Of the many solutions I've tried, I made the best progress by following instructions at https://docs.fedoraproject.org/f27/system-administrators-guide/infrastructure-services/TigerVNC.html
The following commands worked:
sudo dnf install tigervnc-server
sudo cp /lib/systemd/system/vncserver#.service /etc/systemd/system/vncserver#.service
Then I edited /etc/systemd/system/vncserver#.service, replacing <USER> with my user name in the following two lines:
ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i -geometry 1280x1024"
PIDFile=/home/<USER>/.vnc/%H%i.pid
Then I ran:
sudo systemctl daemon-reload
and set a password with:
vncpasswd
Next the site's instructions told me:
With a valid display number, execute the following command:
sudo systemctl enable vncserver#:display_number.service
I've tried using display numbers 0, 1, and 2.
With display number as 1, for example, I got different error messages depending on whether SELinux was set to Enforcing or Permissive.
sudo systemctl start vncserver#:1.service
With 'Enforcing':
Job for vncserver#:1.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status vncserver#:1.service" and "journalctl -xe" for details.
After trying the following steps suggested by SELinux:
sudo ausearch -c 'systemd' --raw | audit2allow -M my-systemd
semodule -i my-systemd.pp
and:
sudo ausearch -c 'geoclue' --raw | audit2allow -M my-geoclue
sudo semodule -i my-geoclue.pp
the error message changed to be same as given here for 'Permissive':
Job for vncserver#:1.service failed because the control process exited with error code.
See "systemctl status vncserver#:1.service" and "journalctl -xe" for details.
The output of systemctl status vncserver#:1.service was as follows:
● vncserver#:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver#.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2018-03-26 12:24:12 EDT; 3min 4s ago
Process: 23294 ExecStart=/usr/sbin/runuser -l jazcap53 -c /usr/bin/vncserver :1 (code=exited, status=98)
Process: 23292 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Mar 26 12:24:12 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
Mar 26 12:24:12 localhost.localdomain systemd[1]: vncserver#:1.service: Control process exited, code=exited status=98
Mar 26 12:24:12 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
Mar 26 12:24:12 localhost.localdomain systemd[1]: vncserver#:1.service: Unit entered failed state.
Mar 26 12:24:12 localhost.localdomain systemd[1]: vncserver#:1.service: Failed with result 'exit-code'.
And sudo journalctl -xe produced:
Mar 26 12:27:41 localhost.localdomain systemd[1]: Started SSSD Kerberos Cache Manager.
-- Subject: Unit sssd-kcm.service has finished start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit sssd-kcm.service has finished starting up.
--
-- The start-up result is done.
Mar 26 12:27:41 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=sssd-kcm c
Mar 26 12:27:41 localhost.localdomain sssd[kcm][23679]: Starting up
Mar 26 12:27:41 localhost.localdomain systemd[1]: Started SSSD Secrets Service responder.
-- Subject: Unit sssd-secrets.service has finished start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit sssd-secrets.service has finished starting up.
--
-- The start-up result is done.
Mar 26 12:27:41 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=sssd-secre
Mar 26 12:27:41 localhost.localdomain sssd[secrets][23680]: Starting up
Mar 26 12:30:04 localhost.localdomain sudo[23858]: jazcap53 : TTY=pts/0 ; PWD=/home/jazcap53 ; USER=root ; COMMAND=/bin/journalctl -xe
Mar 26 12:30:04 localhost.localdomain audit[23858]: USER_CMD pid=23858 uid=1001 auid=1001 ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg
Mar 26 12:30:04 localhost.localdomain audit[23858]: CRED_REFR pid=23858 uid=0 auid=1001 ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='
Mar 26 12:30:04 localhost.localdomain sudo[23858]: pam_systemd(sudo:session): Cannot create session: Already occupied by a session
Mar 26 12:30:04 localhost.localdomain audit[23858]: USER_START pid=23858 uid=0 auid=1001 ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg=
Mar 26 12:30:04 localhost.localdomain sudo[23858]: pam_unix(sudo:session): session opened for user root by (uid=0)
If you do not have Vino installed, GNOME will not display Screen Sharing as an option.
sudo dnf install vino should do it. You can then set up screenshare as per your initial attempt.

mysql randomly stopped working

hi my mysql was working i did nothing on it then today when i went to login to multicraft it gave me error 500 which means theres an issue with mysql and i tried to do $service mysql restart it didnt work so i did $service mysql status and i got this error
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Wed 2016-01-27 16:39:39 CET; 24min >ago
Process: 27320 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 28147 ExecStart=/etc/init.d/mysql start (code=exited, >status=1/FAILURE)
Jan 27 16:39:39 ns3317389.ip-37-59-14.eu systemd[1]: Starting LSB: Start and >sto...
Jan 27 16:39:39 ns3317389.ip-37-59-14.eu mysql[28147]: /etc/init.d/mysql: >ERROR:...
Jan 27 16:39:39 ns3317389.ip-37-59-14.eu systemd[1]: mysql.service: control >proc...
Jan 27 16:39:39 ns3317389.ip-37-59-14.eu systemd[1]: Failed to start LSB: Start >...
Jan 27 16:39:39 ns3317389.ip-37-59-14.eu systemd[1]: Unit mysql.service entered >...
Hint: Some lines were ellipsized, use -l to show in full.
look in your /var/log/mysql/*.log logs
try to start mysql on the commandline
Example:
as root user: mysqld --console