在 Debian jessie 上禁用 MariaDb 不起作用

在 Debian jessie 上禁用 MariaDb 不起作用

我在 Debian jessie 上安装了 MariaDb。我需要将其从自动系统启动中删除。我尝试了推荐的命令,但它们不起作用:

root@debian:/home/gameboy# systemctl disable mysql
Synchronizing state for mysql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d mysql defaults
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d mysql disable
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
root@debian:/home/gameboy# 

root@debian:/home/gameboy# update-rc.d -f mysql disable
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
root@debian:/home/gameboy# 

重启后:

gameboy@debian:~$ su
Password: 
root@debian:/home/gameboy# ps aux |grep mysql
mysql      722  0.9  2.4 968204 94976 ?        Ssl  00:47   0:00 /usr/sbin/mysqld
root      1686  0.0  0.0  13952  2236 pts/0    S+   00:48   0:00 grep mysql
root@debian:/home/gameboy# 

root@debian:/home/gameboy# systemctl status mysql
● mariadb.service - MariaDB database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Mon 2017-03-27 00:47:56 CEST; 2min 24s ago
  Process: 775 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 773 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
  Process: 536 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 519 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 496 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 722 (mysqld)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/mariadb.service
           └─722 /usr/sbin/mysqld

Mar 27 00:47:56 debian mysqld[722]: 2017-03-27  0:47:56 140612694665152 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.35-80.0 started; log...er 1616879
Mar 27 00:47:56 debian mysqld[722]: 2017-03-27  0:47:56 140611906668288 [Note] InnoDB: Dumping buffer pool(s) not yet started
Mar 27 00:47:56 debian mysqld[722]: 2017-03-27  0:47:56 140612694665152 [Note] Plugin 'FEEDBACK' is disabled.
Mar 27 00:47:56 debian mysqld[722]: 2017-03-27  0:47:56 140612694665152 [Note] Server socket created on IP: '127.0.0.1'.
Mar 27 00:47:56 debian mysqld[722]: 2017-03-27  0:47:56 140612694665152 [Note] Reading of all Master_info entries succeded
Mar 27 00:47:56 debian mysqld[722]: 2017-03-27  0:47:56 140612694665152 [Note] Added new Master_info '' to hash table
Mar 27 00:47:56 debian mysqld[722]: 2017-03-27  0:47:56 140612694665152 [Note] /usr/sbin/mysqld: ready for connections.
Mar 27 00:47:56 debian mysqld[722]: Version: '10.1.22-MariaDB-1~jessie'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
Mar 27 00:47:56 debian mysqld[773]: Checking for corrupt, not cleanly closed and upgrade needing tables.
Mar 27 00:47:56 debian systemd[1]: Started MariaDB database server.
Hint: Some lines were ellipsized, use -l to show in full.
root@debian:/home/gameboy# 

如何禁用 MariaDb 的自动启动?

编辑: 这也没有帮助:

root@debian:/home/gameboy# systemctl mask mariadb
Created symlink from /etc/systemd/system/mariadb.service to /dev/null.
root@debian:/home/gameboy#

答案1

就我而言,这最终奏效了:

systemctl disable mariadb.service

要找出正确的名称,请查看systemctl list-units或过滤其结果,即。systemctl list-units | grep maria

相关内容