免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4449 | 回复: 6
打印 上一主题 下一主题

[文本处理] 命令mysql_secure_installation自动交互出错,求纠正 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-01-15 13:48 |只看该作者 |倒序浏览
本帖最后由 longshell 于 2014-01-16 16:19 编辑

执行会有三行提示stty: standard input: Inappropriate ioctl for device

一开始输入的是回车,默认是没有密码

代码如下:
mysql_secure_installation <<EOF

y
123456
123456
y
y
y
y
EOF


执行结果:
-> Complete to secure MySQL installation




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

stty: standard input: Inappropriate ioctl for device
Enter current password for root (enter for none):
stty: standard input: Inappropriate ioctl for device
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] stty: standard input: Inappropriate ioctl for device
New password:
Re-enter new password:
stty: standard input: Inappropriate ioctl for device
Password updated successfully!
Reloading privilege tables..
... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]  ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]  ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]  - Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]  ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

我试了一下,配置成功了,但是就是会有这三行提示   请问这个交互脚本哪边编写错误了

论坛徽章:
9
2015亚冠之阿尔纳斯尔
日期:2015-09-10 16:21:162015亚冠之塔什干火车头
日期:2015-07-01 16:23:022015年亚洲杯之巴勒斯坦
日期:2015-04-20 17:19:46子鼠
日期:2014-11-13 09:51:26未羊
日期:2014-08-28 18:13:36技术图书徽章
日期:2014-02-21 09:30:15酉鸡
日期:2014-01-14 11:12:49天蝎座
日期:2013-12-09 17:56:53平安夜徽章
日期:2015-12-26 00:06:30
2 [报告]
发表于 2014-01-15 13:54 |只看该作者
expect 专干这个

论坛徽章:
0
3 [报告]
发表于 2014-01-15 13:56 |只看该作者
本帖最后由 longshell 于 2014-01-15 13:56 编辑

不用expect回复 2# HH106


   

论坛徽章:
0
4 [报告]
发表于 2014-01-15 15:41 |只看该作者
人呢?。。。。。。。

论坛徽章:
33
ChinaUnix元老
日期:2015-02-02 08:55:39CU十四周年纪念徽章
日期:2019-08-20 08:30:3720周年集字徽章-周	
日期:2020-10-28 14:13:3020周年集字徽章-20	
日期:2020-10-28 14:04:3019周年集字徽章-CU
日期:2019-09-08 23:26:2519周年集字徽章-19
日期:2019-08-27 13:31:262016科比退役纪念章
日期:2022-04-24 14:33:24
5 [报告]
发表于 2014-01-16 10:17 |只看该作者
回复 4# longshell


都去学习expect了
你啥时候开始学习?

论坛徽章:
0
6 [报告]
发表于 2014-01-16 10:56 |只看该作者
呵呵,EXPERT其实我之前一直用过。。这次系统不带,我也不高兴将,索性用直接输入的这种方式。。这个交互没那么复杂。。。我发现程序执行是正常的,就是多了这三行提示。不知道为什么。回复 5# Shell_HAT


   

论坛徽章:
0
7 [报告]
发表于 2014-01-16 16:19 |只看该作者
顶一下。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP