停止 mysqld 的不同方法

您所在的位置:网站首页 linux停掉服务命令 停止 mysqld 的不同方法

停止 mysqld 的不同方法

2024-07-13 14:05:09| 来源: 网络整理| 查看: 265

在 Windows 操作系统中启动/停止 mysqld(又名 MySQL 服务器) 在 Linux(Ubuntu 20.04)操作系统中启动/停止 mysqld(又名 MySQL 服务器) 结论

mysqld 是一个守护服务器程序,也称为 MySQL 服务器。它用于管理具有表和数据库的 MySQL 数据目录。

本教程将指导你了解可用于启动、停止或重新启动 MySQL 服务器 的各种方法。

每个人都必须根据他们使用的操作系统来启动和停止 mysqld。我们将探索使用 Windows 和 Linux (Ubuntu 20.04) 操作系统启动、停止和重新启动 MySQL 服务器的不同方法。

在 Windows 操作系统中启动/停止 mysqld(又名 MySQL 服务器) 方法 1 - 使用 Windows 运行对话框

如果你使用的是 Windows 操作系统,则可以使用 Windows 运行对话框。你可以通过按 Windows+R 打开它。打开后,输入 services.msc(见下文),然后按确定。

搜索 MySQL##(这里 ## 代表版本)。如果你有 MySQL 8.0,请在以下屏幕上查找 MySQL80。

现在,MySQL Server 正在运行。右键单击 MySQL##(将 ## 替换为你的 MySQL 版本)并选择停止。你也可以从此处选择暂停或重新启动。

它将停止 mysqld(MySQL 服务器)。请参阅以下屏幕截图。

你还可以从 services 的菜单栏中启动、停止、暂停或重新启动 MySQL 服务器,如下所示。

方法 2 - 使用 Windows 命令提示符

如果你对 Windows 命令提示符(也称为 CMD)感到满意,也可以从命令行停止 MySQL 服务器。以管理员身份打开命令提示符(请参见下面给出的屏幕截图)。

它将打开一个黑色窗口并转到 MySQL bin 文件夹 C:\Program Files\MySQL\MySQL Server 8.0\bin。

如果你想确认你的 MySQL 服务器是否正在运行,你可以使用以下命令进行检查。用你的用户名替换用户名。

键入给定命令并按 Enter 后,它将要求输入密码。输入你的密码,如果没有,请按回车键。

mysqladmin -u [username] -p status

我们的 MySQL 服务器当前处于活动状态;见下面的截图。

我们可以停止它并在命令行中确认服务器的不活动,如下所示。你也可以在 services.msc 中看到它。

-- replace [username] with yours mysqladmin -u [username] -p shutdown --check status mysqladmin -u [username] -p status

你可以看到以下命令的实际使用,并注意到我们在关闭它后无法连接。

在 Linux(Ubuntu 20.04)操作系统中启动/停止 mysqld(又名 MySQL 服务器)

在 Linux 操作系统中,你可以使用不同的命令来启动/停止 MySQL 服务器。这种变化取决于你使用的 Linux 发行版。

我们在本文中使用 Linux (Ubuntu 20.04)。

如果你也是 Linux (Ubuntu 20.04) 用户,你可以使用以下命令停止 MySQL 服务器,然后检查状态以确认。Fedora 用户可以查看 this 文档,CentOS 命令与 Fedora 非常相似。

-- if you are logged in as superuser (root user) then use the following commands systemctl stop mysql systemctl status mysql -- if you are not logged in as superuser (root user) then use the following commands sudo systemctl stop mysql sudo systemctl status mysql

使用以下命令在 Ubuntu 中启动 MySQL 服务器。

-- if you are logged in as superuser (root user) then use the following commands systemctl start mysql systemctl status mysql -- if you are not logged in as superuser (root user) then use the following commands sudo systemctl start mysql sudo systemctl status mysql -- You can use the following command to make sure that the server launches after reboot systemctl enable mysql # OR sudo systemctl enable mysql

绿点和绿色文本表示你的服务器已启动并正在运行(请参见下面的屏幕截图)。

使用下面给出的命令重新启动 MySQL 服务器。

-- if you are logged in as superuser (root user) then use the following commands systemctl restart mysql systemctl status mysql -- if you are not logged in as superuser (root user) then use the following commands sudo systemctl restart mysql sudo systemctl status mysql

在 Ubuntu 20.04 中执行此操作的另一种方法如下。

-- if you are logged in as superuser (root user) then use the following commands service start mysql service stop mysql -- if you are not logged in as superuser (root user) then use the following commands sudo service start mysql sudo service stop mysql 结论

在本文中,我们了解到 mysqld 也称为 MySQL 服务器。

根据操作系统,我们有不同的方法来启动/停止它。此外,根据你使用的 Linux 发行版,Linux 命令会有所不同。



【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭