Reputation: 2334
With this command:
sudo systemctl restart mysqld
I face with this error:
Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details.
How can I solve it?
Upvotes: 3
Views: 10266
Reputation: 401
Most probably you have huge database that requires a lot of time to start. If that's the case then you can change the service start timeout to something that will work for you. To do that add this line to the service file:
TimeoutSec=1200
or
TimeoutStartSec=1200
If you are using MariaDB then the file is located at this path:
/usr/share/mysql/systemd/mariadb.service
If you are using MySQL then probably the path is:
/usr/share/mysql/systemd/mysqld.service
Upvotes: 2
Reputation: 129
This maybe related to selinux being set to enforcing. Have a look at /etc/selinux/config (on CentOS, location may vary on other distributions). If SELINUX=enforcing, try setting SELINUX=permissive and
In case SELINUX=enforcing is required, have a look at https://www.techrepublic.com/blog/linux-and-open-source/practical-selinux-for-the-beginner-contexts-and-labels/ or other similar posts.
Hope this helps.
Upvotes: 0
Reputation: 15
Reinstalling MySQL
might help:
/var/lib/mysql
and /etc/mycnf
or /etc/mycng.rpmsave
Reboot
the machine MySQL
Upvotes: -1