原文:https://blog.csdn.net/tanliqing2010/article/details/78758878
socket=/percona/3307/data/mysql.sock
[root@localhost ~]#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2. 定义一个`mysqld3307.service`文件
1
[root@localhost ~]# cat /usr/lib/systemd/system/mysqld3307.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]
# Needed to create system tables etc.
ExecStartPre=/usr/bin/mysql_install_db --defaults-file=/root/my.cnf --user=mysql
# Start main service
ExecStart=/usr/bin/mysqld_safe --defaults-file=/root/my.cnf --user=mysql
# Don't signal startup success before a ping works
ExecStartPost=/usr/bin/mysqladmin --defaults-file=/root/my.cnf
# Give up if ping don't get an answer
TimeoutSec=600
Restart=always
PrivateTmp=false
[root@localhost ~]#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
3. 我们需要创建这些文件夹和文件
[root@localhost ~]# mkdir -p /percona/3307/{data,log,run}
[root@localhost ~]# touch /percona/3307/log/mysqld.log
[root@localhost ~]# chown -R mysql:mysql /percona/3307
[root@localhost ~]#
1
2
3
4
4. 使用systemctl启动percona服务
---------------------
作者:tanliqing2010
来源:CSDN
原文:https://blog.csdn.net/tanliqing2010/article/details/78758878
版权声明:本文为博主原创文章,转载请附上博文链接!