mysql5.7单实例自启动服务配置过程

2022-05-15 0 517

1.mysql版本

[root@clq system]# mysql -v
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 49
Server version: 5.7.33 MySQL Community Server (GPL)

2.配置mysqld.service文件

[Unit]
Description=mysql server daemon
After=network.target mysql-keygen.target
[Service]
Type=forking
ExecStart=/usr/local/mysql/support-files/mysql.server start
ExecStop=/usr/local/mysql/support-files/mysql.server   stop
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
[Install]
WantedBy=multi-user.target

3.mysqld.service文件放置的地方

/usr/lib/systemd/system/mysqld.service

4.自启动

 systemctl daemon-reload 
systemctl enable --now mysqld
[root@mysql ~]# ss -antl
State         Recv-Q        Send-Q               Local Address:Port               Peer Address:Port        Process        
LISTEN        0             128                        0.0.0.0:111                     0.0.0.0:*                          
LISTEN        0             32                   192.168.122.1:53                      0.0.0.0:*                          
LISTEN        0             128                        0.0.0.0:22                      0.0.0.0:*                          
LISTEN        0             5                        127.0.0.1:631                     0.0.0.0:*                          
LISTEN        0             128                           [::]:111                        [::]:*                          
LISTEN        0             128                           [::]:22                         [::]:*                          
LISTEN        0             5                            [::1]:631                        [::]:*                          
LISTEN        0             80                               *:3306                          *:*  

以上就是mysql5.7单实例自启动服务配置过程的详细内容,更多关于mysql5.7单实例自启动服务配置的资料请关注NICE源码其它相关文章!

免责声明:
1、本网站所有发布的源码、软件和资料均为收集各大资源网站整理而来;仅限用于学习和研究目的,您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。 不得使用于非法商业用途,不得违反国家法律。否则后果自负!

2、本站信息来自网络,版权争议与本站无关。一切关于该资源商业行为与www.niceym.com无关。
如果您喜欢该程序,请支持正版源码、软件,购买注册,得到更好的正版服务。
如有侵犯你版权的,请邮件与我们联系处理(邮箱:skknet@qq.com),本站将立即改正。

NICE源码网 MySql mysql5.7单实例自启动服务配置过程 https://www.niceym.com/38880.html