首页 新闻 会员 周边

mysql5.7安装脚本中使用mysqladmin报错

0
悬赏园豆:200 [已关闭问题] 关闭于 2019-04-09 17:23

在脚本里面执行到mysqladmin时报错
pass=grep "temporary password" /opt/mydata/log/error.log |awk -F " " '{print $11}'
echo "temporary password - $pass"
/usr/local/mysql/bin/mysqladmin -uroot -p$pass password 'root'

报错的内容如下
temporary password - *aXeNARs&3?O
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/opt/mydata/data/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/opt/mydata/data/mysql.sock' exists!

我把mysqladmin单独执行或者是移到另外的脚本里都没有问题,具体脚本内容和my.cnf太多,我放在博客里https://www.cnblogs.com/ddzj01/p/10676769.html,盼望能得到大家的回复。

小豹子加油的主页 小豹子加油 | 初学一级 | 园豆:13
提问于:2019-04-09 15:06
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册