root下操作
vi /etc/systemd/system/mysqld.service
[Unit]
Description=mysql
After=network.target
After=syslog.target
[Service]
User=mysql
Group=mysql
LimitNOFILE=100000
LimitNPROC=100000
ExecStart=/app/mysql/base/bin/mysqld_safe --defaults-file=/dbdata/my3308/my.cnf
[Install]
WantedBy=multi-user.target
启动mysqld服务
systemctl start mysqld
设置mysqld开机自启动
systemctl enable mysqld