zoukankan      html  css  js  c++  java
  • centos7 systemctl 管理MySQL

    [root@ze11 ~]# ll /usr/local/mysql
    lrwxrwxrwx. 1 mysql mysql 35 Dec 22 21:52 /usr/local/mysql -> mysql-5.7.25-linux-glibc2.12-x86_64
    [root@ze11 ~]# ps -ef |grep mysql
    mysql 21747 1 0 22:38 ? 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql_3306/my.cnf --user=mysql
    mysql 22491 21747 0 22:38 ? 00:00:01 /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql_3306/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql_3306/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/data/mysql_3306/logs/mysqlerror.log --open-files-limit=65535 --pid-file=/data/mysql_3306/run/8202-IPSSDB1.pid --socket=/data/mysql_3306/run/mysql.sock --port=3306
    root 22533 19293 0 22:41 pts/1 00:00:00 grep --color=auto mysql
    [root@ze11 ~]# cat /etc/systemd/system/mysql.service|grep -v "#"
    [Unit]
    Description=MySQL Community Server
    After=network.target
    After=syslog.target
    [Install]
    WantedBy=multi-user.target
    Alias=mysql.service
    [Service]
    User=mysql
    Group=mysql
    PermissionsStartOnly=true
    ExecStart=/usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql_3306/my.cnf --user=mysql
    TimeoutSec=600
    Restart=always
    PrivateTmp=false
    [root@ze11 ~]#

    [root@ze11 ~]# systemctl status mysql.service
    ● mysql.service - MySQL Community Server
    Loaded: loaded (/etc/systemd/system/mysql.service; disabled; vendor preset: disabled)
    Active: active (running) since Tue 2020-12-22 22:38:44 CST; 2min 54s ago
    Main PID: 21747 (mysqld_safe)
    CGroup: /system.slice/mysql.service
    ├─21747 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysql_3306/my.cnf --user=mysql
    └─22491 /usr/local/mysql/bin/mysqld --defaults-file=/data/mysql_3306/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql_3306/data --plugin-d...

    Dec 22 22:38:44 ze11.localdomain systemd[1]: Stopped MySQL Community Server.
    Dec 22 22:38:44 ze11.localdomain systemd[1]: Started MySQL Community Server.
    Dec 22 22:38:45 ze11.localdomain mysqld_safe[21747]: 2020-12-22T14:38:45.406782Z mysqld_safe Logging to '/data/mysql_3306/logs/mysqlerror.log'.
    Dec 22 22:38:45 ze11.localdomain mysqld_safe[21747]: 2020-12-22T14:38:45.459723Z mysqld_safe Starting mysqld daemon with databases from /data/mysql_3306/data
    [root@ze11 ~]#

  • 相关阅读:
    JAVA8学习——Stream底层的实现三(学习过程)
    JAVA8学习——Stream底层的实现二(学习过程)
    JAVA8学习——Stream底层的实现一(学习过程)
    2020年的第一天-我的IDEA出现This license ... has been cancelled
    Java Applet与Java Application的区别
    Spring AOP 详解
    Spring中的代理(proxy)模式
    hibernate中查询方式(二):常用查询
    hibernate中查询方式(一):
    Spring(二)DI( Dependency Injection依赖注入)
  • 原文地址:https://www.cnblogs.com/elontian/p/14175974.html
Copyright © 2011-2022 走看看