Ask Your Question

How to avoid start mysql services at system boot

asked 2017-08-11 09:59:02 -0500

christianbueno gravatar image

I have installed mysql community server 5.7 from the offical yum/dnf repo in the offical website
when i startup my desktop , the mysql services is active(running).

 tony  ~  sudo systemctl status mysqld.service 
[sudo] password for tony: 
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2017-08-11 08:09:29 -05; 1h 41min ago
     Docs: man:mysqld(8)
 Main PID: 1460 (mysqld)
    Tasks: 28 (limit: 4915)
   CGroup: /system.slice/mysqld.service
           └─1460 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/

Aug 11 08:09:24 localhost.localdomain systemd[1]: Starting MySQL Server... Aug 11 08:09:25 localhost.localdomain python3[836]: detected unhandled Python exception in '/usr/sbin/semanage' Aug 11 08:09:25 localhost.localdomain python3[1015]: detected unhandled Python exception in '/usr/sbin/semanage' Aug 11 08:09:29 localhost.localdomain systemd[1]: Started MySQL Server.

the problem is when shutdown my desktop is take too long for do it, because it firts try to stop mysql, but it take a lot time

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted

answered 2017-08-11 10:04:14 -0500

christianbueno gravatar image

Enabling and Disabling Services

The above commands are useful for starting or stopping commands during the current session. To tell systemd to start services automatically at boot, you must enable them.

To start a service at boot, use the enable command:

sudo systemctl enable application.service

This will create a symbolic link from the system's copy of the service file (usually in /lib/systemd/system or /etc/systemd/system) into the location on disk where systemd looks for autostart files (usually /etc/systemd/system/ We will go over what a target is later in this guide).

To disable the service from starting automatically, you can type:

sudo systemctl disable application.service

This will remove the symbolic link that indicated that the service should be started automatically.
Source: Digital Ocean-How To Use Systemctl to Manage Systemd Services and Units

edit flag offensive delete link more

answered 2017-08-11 10:05:23 -0500

fcomida gravatar image

sudo systemctl disable mysqld

edit flag offensive delete link more

answered 2017-08-12 08:10:56 -0500

Robb gravatar image

You can manually start any service during boot-up, e.g mysql, you need to set systemd to disable the service from activate when you OS loaded. Just run :

$ sudo systemctl disable mysqld.service

If you want the service to run automatically during boot-up change the parameter disable to enable.

You saying that mysql took lot of time during shutdown. Then what you need is, run the services only when needed with

$ sudo systemctl start mysqld.service

after done with that, you need to shutdown the services via

$ sudo systemctl stop mysqld.service

For personal use and if you are using gnome to install this services-systemd extension, just add the service and use the GUI to start and stop the services. It much effective for personal use.

edit flag offensive delete link more


services-systemd extension, interesting, thanks

christianbueno gravatar imagechristianbueno ( 2017-08-16 15:35:34 -0500 )edit

Question Tools

1 follower


Asked: 2017-08-11 09:59:02 -0500

Seen: 1,499 times

Last updated: Aug 11 '17