欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-03-07 22:21:01
1.mysql版本[root@clq system]# mysql -vwelcome to the mysql monitor. commands end with ; or \g.your my...

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单实例自启动服务配置的资料请关注其它相关文章!