【发布时间】:2014-08-07 20:59:06
【问题描述】:
我正在尝试通过自动响应来自动化 mysql_secure_installation 脚本。我的代码如下:
echo "& y y abc abc y y y y" | ./usr/bin/mysql_secure_installation
我正在自动化的实际问题如下:
Enter current password for root (enter for none): <enter>
Set root password? [Y/n] y
New password: abc
Re-enter new password: abc
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
但它给了我一个错误“对不起,您不能在此处使用空密码”,但在屏幕上我曾经在第一个问题时按返回键。
【问题讨论】:
-
解决该问题的方法是我手动运行将在 mysql_secure_install 期间触发的所有查询。它现在有效。谢谢。