mysqladmin : Warning Using a password on the command line interface can be insecure

标签 mysql ssl ssh passwords root

当我通过 SSH 连接到我的服务器时,我可以在不使用密码的情况下访问 MySQL 内容。所以当我打字的时候。

mysql -u root -p
它会提示我输入密码,但我可以输入任何内容并访问 MySQL 环境。
所以我尝试使用它来更改root密码,但它不起作用。
mysqladmin -u root password NEW_PASSWORD
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
这个我也试过...
use mysql;
update user set authentication_string=password('NEW_PASSWORD') where user='root';
​flush privileges;
​quit
那没有用。
和这个...
use mysql;
UPDATE mysql.user SET authentication_string = PASSWORD('NEW_PASSWORD') WHERE User = 'root' AND Host = 'localhost';
flush privileges;
​quit
这也没有奏效。
我看过这个教程https://www.techrepublic.com/article/how-to-set-change-and-recover-a-mysql-root-password/但我不明白为什么我应该在文本文件调用 ~/mysql-pwd 中硬编码我的 root 密码并将其放在我的服务器上。这听起来很疯狂。
(问题 1)将密码输入到服务器上的文本文件中真的安全吗?
我也在使用 winmin 来管理我的服务器,这很奇怪,这可能与我无法设置 root 密码的原因有关。
我的网站上有 SSL 证书,它们可以工作。但是,当我访问端口 10000 上的 webmin 环境时,firefox 无法识别 SSL 证书,我必须在 firefox 中添加一个异常(exception),以便我可以看到我的 webmin 环境。
Firefox 使用 SSL 证书的 phpMyAdmin 没有任何问题。
(问题 2)那么这个 webmin 问题是否意味着我的 SSL 证书设置不正确,这在我 SSH 到服务器时会生效吗?

最佳答案

你只需要传递一个参数,--ssl-mode=required进行安全的外壳连接。
我附上了不带/带ssl-mode的屏幕截图enter image description here

关于mysqladmin : Warning Using a password on the command line interface can be insecure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67109670/

相关文章:

MySQL - 如果有的话,那么也选择哪里

php - 2个数据库的差异,保存不同的行

java - Tomcat 应用程序作为使用 TLSv1.2 的另一台服务器的客户端

ssl - 有什么方法可以在 PHPStorm 调试功能中启用 https 连接?

hadoop - 如何在 hadoop 配置中使用亚马逊实例的公共(public) IP?

mysql - 使文本列不为空的正确方法是什么

mysql - 如何删除表的所有外键

c - fprintf 不能在 wireshark 源中工作

使用 meteor 启动将 meteor 应用程序从 nitrous.io 部署到 Linode 服务器时,ssh 连接被拒绝