当我通过 SSH 连接到我的服务器时,我可以在不使用密码的情况下访问 MySQL 内容。所以当我打字的时候。
mysql -u root -p它会提示我输入密码,但我可以输入任何内容并可以访问 MySQL 环境。
所以我尝试使用它来更改 root 密码,但它不起作用。
mysqladmin -u root password NEW_PASSWORDmysqladmin: [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 并将其放在我的服务器上。这听起来很疯狂。
(问题 1)将密码输入服务器上的文本文件是否真的安全?
我也在使用 winmin 来管理我的服务器,这是在做一些奇怪的事情,这可能与我无法设置 root 密码的原因有关。
我的网站上有 SSL 证书,它们可以正常工作。但是,当我访问端口 10000 上的 webmin 环境时,firefox 无法识别 SSL 证书,因此我必须在 firefox 中添加一个例外,以便我可以看到我的 webmin 环境。
Firefox 使用 SSL 证书的 phpMyAdmin 没有任何问题。
(问题 2)那么这个 webmin 问题是否意味着我的 SSL 证书设置不正确,当我通过 SSH 连接到服务器时,这是否会影响?