0
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-08-31 18:03:37 KST; 9min ago
  Process: 6005 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
  Process: 5996 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 6007 (mysqld)
    Tasks: 30 (limit: 4915)
   CGroup: /system.slice/mysql.service
           └─6007 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid

 Aug 31 18:03:37 lenovo-g50-45 mysqld[6005]: 2018-08-31T09:03:37.409469Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
 Aug 31 18:03:37 lenovo-g50-45 mysqld[6005]: 2018-08-31T09:03:37.409772Z 0 [Warning] CA certificate ca.pem is self signed.
 Aug 31 18:03:37 lenovo-g50-45 mysqld[6005]: 2018-08-31T09:03:37.413194Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
 Aug 31 18:03:37 lenovo-g50-45 mysqld[6005]: 2018-08-31T09:03:37.413243Z 0 [Note] IPv6 is available.
 Aug 31 18:03:37 lenovo-g50-45 mysqld[6005]: 2018-08-31T09:03:37.413255Z 0 [Note]   - '::' resolves to '::';
 Aug 31 18:03:37 lenovo-g50-45 mysqld[6005]: 2018-08-31T09:03:37.413294Z 0 [Note] Server socket created on IP: '::'.
 Aug 31 18:03:37 lenovo-g50-45 mysqld[6005]: 2018-08-31T09:03:37.427078Z 0 [Note] Event Scheduler: Loaded 0 events
 Aug 31 18:03:37 lenovo-g50-45 mysqld[6005]: 2018-08-31T09:03:37.427439Z 0 [Note] /usr/sbin/mysqld: ready for connections.
 Aug 31 18:03:37 lenovo-g50-45 mysqld[6005]: Version: '5.7.23-0ubuntu0.18.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
 Aug 31 18:03:37 lenovo-g50-45 systemd[1]: Started MySQL Community Server.

Like above status, MySQL starts well when PC is rebooted. But strangely, there isn't any files named 'mysql' in /etc/init.d folder.

How does MySQL is started without initialization script when booting the PC? How can I add MySQL to init.d folder?

1 Answer 1

0

Your output indicates the MySQL service file is at /lib/systemd/system/mysql.service.

/etc/init.d is legacy and the developers have adapted the software to be started by systemd.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .