centos7systemctl管理mysql

centos 7 開始使用systemctl 管理服務(wù)

創(chuàng)新互聯(lián)建站是專業(yè)的紅河哈尼網(wǎng)站建設(shè)公司,紅河哈尼接單;提供成都做網(wǎng)站、網(wǎng)站設(shè)計(jì),網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行紅河哈尼網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!

服務(wù)腳本目錄 /etc/systemd/system/MySQL.service

腳本如下:

#

# Simple MySQL systemd service file

#

# systemd supports lots of fancy features, look here (and linked docs) for a full list: 

#  http://www.freedesktop.org/software/systemd/man/systemd.exec.html

#

# Note: this file ( /usr/lib/systemd/system/mysql.service )

# will be overwritten on package upgrade, please copy the file to 

#

#  /etc/systemd/system/mysql.service 

#  

# to make needed changes.

# systemd-delta can be used to check differences between the two mysql.service files.

#

[Unit]

Description=MySQL Community Server

After=network.target

After=syslog.target

[Install]

WantedBy=multi-user.target

Alias=mysql.service

[Service]

User=mysql

Group=mysql

# Execute pre and post scripts as root

PermissionsStartOnly=true

# Needed to create system tables etc.

#ExecStartPre=/usr/bin/mysql-systemd-start pre

# Start main service

ExecStart=/application/mysql/bin/mysqld_safe

# Don't signal startup success before a ping works

#ExecStartPost=/usr/bin/mysql-systemd-start post

# Give up if ping don't get an answer

TimeoutSec=600

Restart=always

PrivateTmp=false

---

 mysqld_pre_systemd (RPM platforms), mysql-system-start (Debian platforms): Support script for the unit file. This script assists in creating the error log file only if the log location matches a pattern (/var/log/mysql*.log for RPM platforms, /var/log/mysql/*.log for Debian platforms). In other cases, the error log directory must be writable or the error log must be present and writable for the user running the mysqld process.

如果 mysql error log 設(shè)置在 /var/log 下

以下是percona mysql 設(shè)置


[root@c52cbe15cfa3 system]# cat mysqld.service 

#

# Systemd service file for Percona Server

#

# # This service file is to start PS just with mysqld_safe

#

[Unit]

Description=MySQL Percona Server

After=network.target

After=syslog.target

[Install]

WantedBy=multi-user.target

Alias=mysql.service

[Service]

# Execute pre and post scripts as root

PermissionsStartOnly=true

# Needed to create system tables etc.

ExecStartPre=/usr/bin/mysql-systemd pre

# Start main service

ExecStart=/usr/bin/mysqld_safe

# Don't signal startup success before a ping works

ExecStartPost=/usr/bin/mysql-systemd post

# Give up if ping don't get an answer

TimeoutSec=600

Restart=always

PrivateTmp=false

[root@c52cbe15cfa3 system]# pw


文章標(biāo)題:centos7systemctl管理mysql
鏈接分享:http://bm7419.com/article18/psdjgp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作、定制網(wǎng)站、做網(wǎng)站、微信公眾號(hào)、全網(wǎng)營銷推廣網(wǎng)站導(dǎo)航

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)