如何从mysql_secure_installation退出?

发布于 2025-01-29 00:48:32 字数 383 浏览 3 评论 0原文

安装过程的屏幕截图

您可以在图像(链接)上看到我开始安装通过输入mysql

mysql_secure_installation

ubuntu 20.04终端上。

但是现在我只想取消(退出)安装。该过程现在在密码设置部分(如上图中)。

我尝试了Ctrl+X,Ctrl+Q,Ctrl+D,ESC,但它们都没有起作用。

我应该关闭终端窗口吗? (我希望该过程不会保存任何东西)

我正在等待您的帮助,谢谢。

Screenshot of the installation process

As you can see at the image (link above) I started an installation of mysql by typing

mysql_secure_installation

on the Ubuntu 20.04 terminal.

But now I just want to cancel (exit) the installation. The process is now in the password setting section (like in the image above).

I tried ctrl+x, ctrl+q, ctrl+d, ESC but none of them worked.

Should I just close the terminal window? (I want that nothing will be saved of the process)

I'm waiting for your help, thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

尴尬癌患者 2025-02-05 00:48:32

来自另一个终端的解决方案

sudo kill $(ps aux | grep mysql_secure_installation | grep -v grep | awk '{print $2}')

每个QT-X的注释,如果您的系统支持PGREP,则可以使用:

sudo kill $(pgrep mysql_secure_installation)

然后可以再次运行“ mysql_secure_installation”。但是您可能想阅读以下以下的“为什么我为什么知道这一部分”的“为什么” .....,这可以解释为什么您必须首先(对于某些人)首先退出'mysql_secure_installation'。

为什么出于某种原因知道这一点

,最近我必须在运行此脚本之前先设置我的根密码:

> mysql
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword';

或者我最终进入了无法设置密码的无尽循环,而消息是:

Failed! Error: SET PASSWORD has no significance for user ‘root’@’localhost’ as the authentication method used doesn’t store authentication data in the MySQL server

The Solution

From another terminal:

sudo kill $(ps aux | grep mysql_secure_installation | grep -v grep | awk '{print $2}')

Per qt-x's comment, if your system supports pgrep you can use:

sudo kill $(pgrep mysql_secure_installation)

You can then run 'mysql_secure_installation' again. But you may want to read the "Why I Know This" section below first....., which may explain why you have to exit 'mysql_secure_installation' in the first place [for some people].

Why I Know This

For some reason, recently I've had to set my root password first before running this script:

> mysql
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword';

Or I end up in an endless loop where I can't set the password, and the message is:

Failed! Error: SET PASSWORD has no significance for user ‘root’@’localhost’ as the authentication method used doesn’t store authentication data in the MySQL server
疾风者 2025-02-05 00:48:32

CTRL+C将有效,但仅在以下位置:

您是否希望继续提供密码?(按y | y是是,
任何其他键):

ctrl+c will work, but only at the following position:

Do you wish to continue with the password provided?(Press y|Y for Yes,
any other key for No) :

深巷少女 2025-02-05 00:48:32

更简单命令。

sudo pkill -f mysql_secure_installation

也许杀死mysql_secure_installation pgrep -af mysql_secure_installation以获取当前状态的

Maybe a simpler command to kill mysql_secure_installation

sudo pkill -f mysql_secure_installation

pgrep -af mysql_secure_installation to get the current state.

二智少女 2025-02-05 00:48:32

非常简单,只需键入ctrl+c
它对我有用,对你不认识

very easy, just type ctrl+c
it worked for me, don't know about you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文