갈루아의 반서재

/etc/init.d 에 위치한 스크립트를 사용하여 MySQL 을 시작, 종료, 재시작할 수 있다. 다음과 같다.


시작

1
~$ sudo /etc/init.d/mysql start
cs


종료

1
~$ sudo /etc/init.d/mysql start
cs


재시작하기

1
2

~$ sudo /etc/init.d/mysql restart
[ ok ] Restarting mysql (via systemctl): mysql.service.
 
cs


구동 상태 확인하기

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
~$ sudo /etc/init.d/mysql status
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-11-08 09:39:08 UTC; 9s ago
  Process: 26410 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
  Process: 26388 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 26412 (mysqld)
    Tasks: 27 (limit: 3571)
   CGroup: /system.slice/mysql.service
           └─26412 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
 
Nov 08 09:39:08 hilbert systemd[1]: Stopped MySQL Community Server.
Nov 08 09:39:08 hilbert systemd[1]: Starting MySQL Community Server...
Nov 08 09:39:08 hilbert systemd[1]: Started MySQL Community Server.
 
cs