gpt4 book ai didi

mysql - 如何获取 mysql_config_editor

转载 作者:行者123 更新时间:2023-12-03 23:45:08 27 4
gpt4 key购买 nike

我跑了sudo apt-get install mysql-client它安装正确。然后我跑了mysql_config_editor print我得到了

mysql_config_editor: not found
mysql_config_editor没有出现在 /usr/bin就像我期望的那样,就像在我的另一台机器上一样。
在它工作的机器上, mysql --version显示
mysql  Ver 8.0.21-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))
在不工作的机器上, mysql --version显示
mysql  Ver 15.1 Distrib 10.1.45-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
如何安装 mysql_config_editor 附带的 mysql 版本或安装 mysql_config_editor实用程序本身?

最佳答案

在 MariaDB 上,由于我们没有像 mysql_config_editor 这样的实用程序来使用混淆密码创建 ~/.login.cnf,MariaDB 都不会读取它,因此可以使用纯文本降级为 ~/.my.cnf 文件:

[client] 
user=my_username
password=my_password
#port=mysql_port
#socket=my_socket
#database=my_default_dbname
然后更改访问模式:
chmod 600 ~/.my.conf
现在只有您可以阅读这个纯文本文件。
这避免了您以不安全的方式在 debian os 的命令行上键入用户和密码,可通过 ps 命令读取。
mysql
引用 https://mariadb.com/kb/en/configuring-mariadb-with-option-files/

关于mysql - 如何获取 mysql_config_editor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63254673/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com