centos7.x设置mysql自启动

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

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

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

猜你在找的CentOS相关文章