# Copyright (c) 2016, 2025, Oracle and/or its affiliates. # # # # # # # # # # # # # # # # # # # # # The lines above are intentionally left blank # # systemd service file for MySQL forking server # [Unit] Description=MySQL Server Documentation=man:mysqld(8) Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html After=network-online.target Wants=network-online.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=mysql Group=mysql Type=notify # Disable service start and stop timeout logic of systemd for mysqld service. TimeoutSec=0 # Execute pre and post scripts as root PermissionsStartOnly=true # Needed to create system tables ExecStartPre=/usr/bin/mysqld_pre_systemd %I # Start main service ExecStart=/usr/sbin/mysqld --defaults-group-suffix=@%I $MYSQLD_OPTS # Use this to switch malloc implementation # EnvironmentFile=-/etc/sysconfig/mysql EnvironmentFile="MYSQLD_OPTS=--defaults-file=/etc/my.cnf" # Sets open_files_limit LimitNOFILE = 10000 Restart=on-failure RestartPreventExitStatus=1 # Set enviroment variable MYSQLD_PARENT_PID. This is required for restart. Environment=MYSQLD_PARENT_PID=1 PrivateTmp=false