服务器之家:专注于服务器技术及软件下载分享
分类导航

Mysql|Sql Server|Oracle|Redis|MongoDB|PostgreSQL|Sqlite|DB2|mariadb|Access|数据库技术|

服务器之家 - 数据库 - Mysql - mysql5.7单实例自启动服务配置过程

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

2021-09-29 16:11神慕蔡蔡 Mysql

这篇文章主要介绍了mysql5.7单实例自启动服务配置的过程,附含配置源码,有需要的朋友可以借鉴参考下,希望可以有所帮助,感谢阅读

1.mysql版本

?
1
2
3
4
[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文件

?
1
2
3
4
5
6
7
8
9
10
11
12
[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文件放置的地方

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

4.自启动

?
1
2
3
4
5
6
7
8
9
10
11
12
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单实例自启动服务配置的资料请关注服务器之家其它相关文章!

原文链接:https://blog.csdn.net/qq_47945825/article/details/119929001

延伸 · 阅读

精彩推荐