日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

systemctl与mysql多实例_mysql mariadb 多版本多实例 开机启动

發(fā)布時間:2024/9/19 数据库 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 systemctl与mysql多实例_mysql mariadb 多版本多实例 开机启动 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

———-mysql多實例開機啟動及加入服務———————–

將腳本cp到init.d目錄

cd /usr/mysqlsoft5.6.38_3346/support-files/

[root@mysql02 support-files]# cp mysql.server /etc/init.d/mysqld3346

[root@mysql02 support-files]# systemctl status mysqld3346

Unit mysqld3346.service could not be found.

[root@mysql02 support-files]# systemctl enable mysqld3346??? —-開機啟動

mysqld3346.service is not a native service, redirecting to /sbin/chkconfig.?? —–有報錯,開機啟動加入失敗

Executing /sbin/chkconfig mysqld3346 on

[root@mysql02 support-files]# systemctl status mysqld3346

● mysqld3346.service – LSB: start and stop MySQL

Loaded: loaded (/etc/rc.d/init.d/mysqld3346; bad; vendor preset: disabled)

Active: inactive (dead)

Docs: man:systemd-sysv-generator(8)

[root@mysql02 support-files]#

[root@mysql02 support-files]# systemctl start mysqld3346

[root@mysql02 support-files]# systemctl status mysqld3346

● mysqld3346.service – LSB: start and stop MySQL

Loaded: loaded (/etc/rc.d/init.d/mysqld3346; bad; vendor preset: disabled)

Active: active (running) since Mon 2017-10-30 03:25:57 EDT; 10s ago

Docs: man:systemd-sysv-generator(8)

Process: 10651 ExecStart=/etc/rc.d/init.d/mysqld3346 start (code=exited, status=0/SUCCESS)

CGroup: /system.slice/mysqld3346.service

├─10659 /bin/sh /usr/mysqlsoft5.6.38_3346/bin/mysqld_safe –datadir=/usr/mysqldata/3346 –pid-file=/…

└─11368 /usr/mysqlsoft5.6.38_3346/bin/mysqld –basedir=/usr/mysqlsoft5.6.38_3346 –datadir=/usr/mysqldate5…

Oct 30 03:25:54 mysql02 systemd[1]: Starting LSB: start and stop MySQL…

Oct 30 03:25:57 mysql02 mysqld3346[10651]: Starting MySQL.. SUCCESS!

Oct 30 03:25:57 mysql02 systemd[1]: Started LSB: start and stop MySQL.

[root@mysql02 support-files]#

查看是否開啟開機啟動

[root@mysql02 support-files]# systemctl is-enabled mysqld3346???? —-一種方式

mysqld3346.service is not a native service, redirecting to /sbin/chkconfig.

Executing /sbin/chkconfig mysqld3346 –level=5

enabled

[root@mysql02 support-files]# chkconfig –list mysqld3346 —兩種方式

mysqld3346???????? 0:off??? 1:off??? 2:on??? 3:on??? 4:on??? 5:on??? 6:off

—————mariadb多實例開機啟動—————

現(xiàn)在增加 多實例開機啟動腳本

vim /etc/rc.d/init.d/mumysql

#!/bin/bash

#add for chkconfig

#chkconfig: 2345 70 30

#description: mysql autostart

#processname: mumysql

/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg3325.cnf –log=/var/log/mysql/mysql_3325.log start

#end

說明:

2345是指腳本的運行級別,即在2345這4種模式下都可以運行,234都是文本界面,5就是圖形界面X

70是指腳本將來的啟動順序號,如果別的程序的啟動順序號比70小(比如44、45),則腳本需要等這些程序都啟動以后才啟動。

30是指系統(tǒng)關閉時,腳本的停止順序號。

chmod +x /etc/rc.d/init.d/mumysql

systemctl enable mumysql

[root@shtsmysql02 support-files]# systemctl is-enabled mumysql

mumysql.service is not a native service, redirecting to /sbin/chkconfig.

Executing /sbin/chkconfig mumysql –level=5

enabled

[root@shjhmysql01 init.d]# chkconfig –add mumysql?? 在系統(tǒng)里增加開記機啟動

[root@shjhmysql01 init.d]# chkconfig –list?????????? 查看開機啟動列表。

mumysql??????????? 0:off??? 1:off??? 2:on??? 3:on??? 4:on??? 5:on??? 6:off

netconsole???????? 0:off??? 1:off??? 2:off??? 3:off??? 4:off??? 5:off??? 6:off

network??????????? 0:off??? 1:off??? 2:on??? 3:on??? 4:on??? 5:on??? 6:off

—————————————————–

總結

以上是生活随笔為你收集整理的systemctl与mysql多实例_mysql mariadb 多版本多实例 开机启动的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。