English
Ask Your Question
0

How to avoid start mysql services at system boot

asked 2017-08-11 14:59:02 +0000

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)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
 Main PID: 1460 (mysqld)
    Tasks: 28 (limit: 4915)
   CGroup: /system.slice/mysqld.service
           └─1460 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

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
2

answered 2017-08-11 15:05:23 +0000

fcomida gravatar image

sudo systemctl disable mysqld

edit flag offensive delete link more
2

answered 2017-08-11 15:04:14 +0000

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/some_target.target.wants. 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
0

answered 2017-08-12 13:10:56 +0000

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

Comments

services-systemd extension, interesting, thanks

christianbueno ( 2017-08-16 20:35:34 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

Follow
1 follower

Stats

Asked: 2017-08-11 14:59:02 +0000

Seen: 75 times

Last updated: Aug 11