centos7.x设置mysql自启动

前端之家收集整理的这篇文章主要介绍了centos7.x设置mysql自启动前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

编译安装MysqL并成功初始化后

  1. whereis MysqL
  1. cd /usr/local/MysqL
  2. cp support-files/my-default.cnf /etc/my.cnf
  3.  
  4. vi /etc/systemd/system/MysqLd.service
  1. [Unit]
  2. Description=MysqL Server
  3. Documentation=man:MysqLd(8)
  4. Documentation=http://dev.MysqL.com/doc/refman/en/using-systemd.html
  5. After=network.target
  6. After=syslog.target
  7.  
  8. [Install]
  9. WantedBy=multi-user.target
  10.  
  11. [Service]
  12. User=MysqL
  13. Group=MysqL
  14. ExecStart=/usr/local/MysqL/bin/MysqLd --defaults-file=/etc/my.cnf
  15. LimitNOFILE = 5000
  1. #添加到开机启动
  2. systemctl enable MysqLd.service
  3. systemctl start MysqLd
  4. systemctl stop MysqLd
  5. systemctl status MysqLd

猜你在找的CentOS相关文章