———-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多实例开机启动—————

现在增加 多实例开机启动脚本

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是指系统关闭时,脚本的停止顺序号。

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   在系统里增加开记机启动

[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 多版本多实例 开机启动相关推荐

  1. mysql调试事件_mysql日志管理分析调试实例_mysql

    以下的文章主要介绍的是mysql 操作日志查看的实际操作步骤以及对其实际操作步骤的具体描述,假如你在实际操作中遇到相似的情况,但是你却不知道对其如何正确的解决,那么以下的文章对你而言一定是良师益友. ...

  2. 创建mysql代码实例_MySQL筹建系列之多实例_mysql

    mysql搭建系列之多实例 所谓多实例,就是在一台服务器上搭建.运行多个MySQL实例,每个实例使用不同的服务端口,通过不同的socket监听:物理上,每个实例拥有独立的参数配置文件及数据库. 通常情 ...

  3. mysql rpm 安装多实例_MySQL搭建系列之多实例

    所谓多实例.就是在一台server上搭建.执行多个MySQL实例,每一个实例使用不同的服务port.通过不同的socket监听:物理上,每一个实例拥有独立的參数配置文件及数据库. 通常情况下.一台se ...

  4. mysql 5.6多实例_MySQL 5.6.x多实例配置

    前提准备 个人不喜欢采用mysqlmulti方式配置多实例,还是采用多实例多进程方式配置. 1, 准备数据库实例datadir目录 # mkdir -p /usr/local/mysql/mysql3 ...

  5. mysql 一致性读_mysql/mariadb知识点总结(27):一致性读,快照读

    在本博客中,"mysql"是一个系列文章,这些文章主要对mysql/mariadb的常用知识点进行了总结,每一篇博客总结的知识点有所不同,具体内容可参考mysql文章列表. mys ...

  6. mysql maria引擎_MySQL/mariadb知识点——存储过程及存储引擎

    MySQL架构 连接器 连接池,安全认证.线程池.连接限制.检查内存.缓存 SQL接口 DML.DDL SQL解析器,对SQL语句的权限检查.解析为二进制程序 优化器,优化访问路径 缓存cache,b ...

  7. mysql 页分裂_mysql聚簇索引的页分裂原理实例分析

    本文实例讲述了mysql聚簇索引的页分裂.分享给大家供大家参考,具体如下: 在MySQL中,MyISAM采用的是非聚簇索引的,InnoDB存储引擎是采用聚簇索引的. 聚簇结构的特点: 根据主键查询条目 ...

  8. 多字段mysql触发器实例_mysql触发器原理与用法实例分析

    本文实例讲述了mysql触发器原理与用法.分享给大家供大家参考,具体如下: 本文内容: 什么是触发器 创建触发器 单条触发器语句 多条触发器语句 查看触发器 删除触发器 触发器的新旧记录引用 首发日期 ...

  9. mysql嵌入式语句_MySQL/MariaDB 语句速查笔记

    平时实际开发的时候,其实并不太依赖 MySQL 作为 关系型数据库 中的 "关系" 这一属性,更多地只是把 MySQL 作为数据存储的介质.因此 MySQL 语句其实很少写,所以本 ...

最新文章

  1. 金融业加速智能化,解析360金融AI基础架构和应用
  2. python拼音怎么写-Python 返回汉字的汉语拼音
  3. 使用keepalived加lvs做负载均衡,访问后端的服务器,2分钟后超时,需要重新登录...
  4. 十图详解TensorFlow数据读取机制(附代码)
  5. 对datatable进行linq过滤
  6. Django之验证码的实现,简单快捷的方法
  7. git学习(四):理解git暂存区(stage)
  8. FBI 和 NSA 披露俄罗斯国家黑客使用的 Linux 恶意软件
  9. Digilent提供的PmodOLEDrgb驱动程序
  10. Inondb中的checkpoint
  11. Java应用中使用ShutdownHook友好地清理现场
  12. Kafka权威指南,Kafka消费者
  13. 《漫画算法2》2021全新进阶版来袭!
  14. 记录从网页下载ppt的过程。
  15. RabbitMmq基础(三)入门应用
  16. 恶意代码分析实战_实验练习
  17. Windows设置电脑每天自动重启
  18. Linux debian解压和压缩.rar文件教程
  19. 娱乐游戏及计算机动画论文,【动画艺术论文】动画艺术论文范文(共40篇)
  20. Package | 解决 Could not build wheels for opencv-python which use PEP 517 and cannot be installed

热门文章

  1. lambada表达式
  2. Python基础概念_14_常见术语
  3. QT中关于窗口全屏显示与退出全屏的实现
  4. OpenCV中像素逻辑运算:逻辑与运算
  5. 思科交换机VTP配置
  6. virtualBox下安装Linux6.4
  7. linux下改变文件的字符编码
  8. numpy矩阵运算和常用函数
  9. c# pictureBox1.Image的获得图片路径的三种方法 winform
  10. 2013年1月18日调试触发器“表发生了变化,触发器或函数不能读它”的出现原因,以及解决方案...