相关疑难解决方法(0)

通过shell脚本使用echo命令自动执行mysql_secure_installation

我试图使用自动响应自动化mysql_secure_installation脚本.我的代码如下:

echo "& y y abc abc y y y y" | ./usr/bin/mysql_secure_installation
Run Code Online (Sandbox Code Playgroud)

我自动化的实际问题如下:

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
Run Code Online (Sandbox Code Playgroud)

但它给了我一个错误"抱歉,你不能在这里使用空密码",但在屏幕上,我曾经按下第一个问题的返回键.

mysql linux shell

56
推荐指数
7
解决办法
5万
查看次数

错误 1356 (HY000):视图 'mysql.user' 引用无效的表或列或函数或视图的定义者/调用者缺乏使用它们的权限

我试过查询但错误
有人解决了错误吗?

MariaDB [mysql]> UPDATE user SET Host='%' WHERE User='root';

错误 1356 (HY000):视图 'mysql.user' 引用无效的表或列或函数或视图的定义者/调用者缺乏使用它们的权限

mysql mariadb

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

mysql ×2

linux ×1

mariadb ×1

shell ×1