千家信息网

怎么使用OEL7.2系统system管理源码安装的mysql5.7

发表于:2025-02-11 作者:千家信息网编辑
千家信息网最后更新 2025年02月11日,这篇文章主要讲解了"怎么使用OEL7.2系统system管理源码安装的mysql5.7",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"怎么使用OEL7.
千家信息网最后更新 2025年02月11日怎么使用OEL7.2系统system管理源码安装的mysql5.7

这篇文章主要讲解了"怎么使用OEL7.2系统system管理源码安装的mysql5.7",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"怎么使用OEL7.2系统system管理源码安装的mysql5.7"吧!

1描述
使用OEL7.2系统 system 管理源码安装的mysql5.7多实例.
2操作环境
2.1OS info
OEL7.2 x64
3过程设计
编辑/etc/my.cnf ,本文创建mysqld@3307.service与mysqld@3308.service两个实例,分别对应3307与3308端口。创建相应实例目录。
复制systemd 服务文件,复制mysql base目录下/usr/local/mysql/usr/lib/systemd/system/的mysqld@.service文件到系统/usr/lib/systemd/system目录下,并重命名成与多实例名一致的文件。
systemctl daemon-reload
systemctl start mysqld@3307.service
systemctl start mysqld@.service3308
4详细步骤操作
[root@localhost ~]# vi /etc/my.cnf
[root@localhost ~]# cat !$
cat /etc/my.cnf
[mysqld@3307]
datadir=/usr/local/mysql/data/3307
socket=/usr/local/mysql/data/3307/mysql.sock
port=3307
log-error=/var/log/mysqld-service3307.log
[mysqld@3308]
datadir=/usr/local/mysql/data/3308
socket=/usr/local/mysql/data/3308/mysql.sock
port=3308
log-error=/var/log/mysqld-service3308.log
[root@localhost ~]# mkdir -p /usr/local/mysql/data/3307
[root@localhost ~]# mkdir -p /usr/local/mysql/data/3308
[root@localhost ~]# chown -R mysql.mysql /usr/local/mysql/data/
[root@localhost ~]# cd /usr/lib/systemd/system
[root@localhost system]# ls -l mysqld*
-rw-r--r--. 1 root root 1637 May 3 03:07 mysqld.service
-rw-r--r--. 1 root root 1668 May 3 03:07 mysqld@.service
[root@localhost system]# cp mysqld@.service mysqld@3307
[root@localhost system]# cp mysqld@.service mysqld@3308
[root@localhost system]# systemctl daemon-reload
[root@localhost system]# mkdir /var/run/mysqld/
[root@localhost system]# chown -R mysql.mysql /var/run/mysqld
[root@localhost system]# cd /var/log/
[root@localhost log]# ls -lrt|tail
-rw-r--r--. 1 root root 8460 May 8 01:20 boot.log
-rw-------. 1 root root 1739 May 8 01:20 cron
-rw-r--r--. 1 root root 360 May 8 01:20 wpa_supplicant.log
-rw-------. 1 root root 594 May 8 01:20 maillog
-rw-rw-r--. 1 root utmp 22656 May 8 01:21 wtmp
-rw-r--r--. 1 root root 291416 May 8 01:21 lastlog
-rw-r-----. 1 mysql mysql 4377 May 8 01:24 mysqld-service3307.log
-rw-r-----. 1 mysql mysql 4449 May 8 01:24 mysqld-service3308.log
-rw-------. 1 root root 540273 May 8 01:24 messages
-rw-------. 1 root root 7764 May 8 01:24 secure
[root@localhost log]# grep password mysqld-service3307.log
2018-05-07T17:24:01.123362Z 1 [Note] A temporary password is generated for root@localhost: x&aQ/IT&p5%u
[root@localhost log]# grep password mysqld-service3308.log
2018-05-07T17:24:17.635837Z 1 [Note] A temporary password is generated for root@localhost: xt2aq-KYGWnt
[root@localhost log]# /usr/local/mysql/bin/mysql -uroot -p'x&aQ/IT&p5%u' -S /usr/local/mysql/data/3307/mysql.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.22
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye
[root@localhost log]# /usr/local/mysql/bin/mysql -uroot -p'xt2aq-KYGWnt' -S /usr/local/mysql/data/3308/mysql.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.22
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye
[root@localhost log]#
[root@localhost log]# systemctl stop mysqld@330*
[root@localhost log]# ps -ef |grep mysql
root 3328 2861 0 01:32 pts/0 00:00:00 grep --color=auto mysql
[root@localhost log]# systemctl start mysqld@330*
[root@localhost log]# ps -ef |grep mysql
root 3335 2861 0 01:32 pts/0 00:00:00 grep --color=auto mysql
[root@localhost log]# systemctl start mysqld@330*
[root@localhost log]# systemctl start mysqld@3307
[root@localhost log]# systemctl start mysqld@3308
[root@localhost log]# ps -ef |grep mysql
mysql 3367 1 5 01:32 ? 00:00:00 /usr/local/mysql/bin/mysqld --defaults-group-suffix=@3307 --daemonize --pid-file=/var/run/mysqld/mysqld-3307.pid
mysql 3420 1 10 01:32 ? 00:00:00 /usr/local/mysql/bin/mysqld --defaults-group-suffix=@3308 --daemonize --pid-file=/var/run/mysqld/mysqld-3308.pid
root 3449 2861 0 01:32 pts/0 00:00:00 grep --color=auto mysql
[root@localhost log]# systemctl stop mysqld@330*
[root@localhost log]# ps -ef |grep mysql
root 3459 2861 0 01:32 pts/0 00:00:00 grep --color=auto mysql
[root@localhost log]# systemctl start mysqld@330*
[root@localhost log]# ps -ef |grep mysql
root 3466 2861 0 01:33 pts/0 00:00:00 grep --color=auto mysql
[root@localhost log]#

感谢各位的阅读,以上就是"怎么使用OEL7.2系统system管理源码安装的mysql5.7"的内容了,经过本文的学习后,相信大家对怎么使用OEL7.2系统system管理源码安装的mysql5.7这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!

系统 源码 管理 实例 文件 目录 学习 内容 一致 两个 就是 思路 情况 文章 更多 步骤 环境 知识 知识点 端口 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 洛阳有资质的软件开发评审公司 智能网络技术概念 搞软件开发有前途吗 前端用甚么软件开发 物联网系统数据库中数据特点 南宁直销软件开发公司 网络安全管理岗位考什么 jpa 自动创建数据库表 一台服务器主机三个显示器 世界技能大赛网络技术 前端用户信息保存到数据库 深圳服务器系统运维服务方案报价 汽车数据库软件有哪些 广州猫王互联网科技 sql语句刷新数据库 靠谱的app软件开发公司 安卓软件开发研究内容 万江手机软件开发 华为北京软件开发工资 深圳商城软件开发外包公司有哪些 软件技术和计算机网络技术的区别 合金装备5服务器 封号后用不同服务器还会封吗 华为的网络安全维护是什么 怎样把复制的内容粘贴到数据库 网络安全教育有什么意义 软件开发考核 不足之处 数据库资源管理系统有哪些 用云服务器做深度学习好吗 网络安全管理制度是啥
0