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 ~]#

  • 相关阅读:
    pycharm使用常见设置
    LeetCode OJ:Insertion Sort List (插入排序链表)
    LeetCode OJ:Reverse Linked List (反转链表)
    Foundations of Qt Development 学习笔记 Part1 Tips1-50
    TCPL学习毕节:第六章hash表
    TCPL学习笔记:4-12以及4-13。关于使用递归的问题。
    几种常见排序算法的C++描述
    一些灵巧的求并算法
    vs中: 错误,未定义的标识符getline 的解决方法
    QT中给程序加上主界面的图标
  • 原文地址:https://www.cnblogs.com/elontian/p/14175974.html
Copyright © 2011-2022 走看看