安装 MySQL Workbench 但文件 /etc/my.cnf 不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21177562/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 19:50:25  来源:igfitidea点击:

Installing MySQL Workbench but File /etc/my.cnf doesn't exist

mysqlunixmysql-workbenchworkbenchmy.cnf

提问by Didi Bui

I managed to download the MySQL DMG archive to my OS (mac OS X). It works if I use the command line. Now, I'm trying to install MySQL Workbench. I've created MySQL Connection but once I'm testing the host machine settings, I get:

我设法将 MySQL DMG 存档下载到我的操作系统 (mac OS X)。如果我使用命令行,它会起作用。现在,我正在尝试安装 MySQL Workbench。我已经创建了 MySQL 连接,但是一旦我测试了主机设置,我就会得到:

Checking command 'ps xa | grep "/usr/local/mysql.*/bin/[m]ysqld"'
Server detected as running
Check if /etc/my.cnf can be accessed
Operation failed: File /etc/my.cnf doesn't exist

I'm trying to find the file my.cnf and I get:

我试图找到文件 my.cnf 并且我得到:

Didis-MacBook:~ Didi$ find . -type f -name "*my.cnf*"
find: ./perms/newdir: Permission denied

So I tried to create my own "my.cnf" by entering:

所以我尝试通过输入来创建我自己的“my.cnf”:

cd /usr/local/mysql/support-files/
sudo cp my-huge.cnf /etc/my.cnf

Then it asked for a password. I don't remember setting up a password. So I typed:

然后它要求输入密码。我不记得设置密码。所以我输入:

/usr/local/psa/bin/admin --show-password

and get:

并得到:

-bash: /usr/local/psa/bin/admin: No such file or directory.

I believe my password should be in /etc/passwd but I have no dir "etc" in my system!

我相信我的密码应该在 /etc/passwd 中,但我的系统中没有目录“etc”!

I'm running out of ideas, can somebody help me please?

我的想法快用完了,有人可以帮我吗?

回答by Didi Bui

I figured it out:

我想到了:

  1. Went to my terminal and typed:

     passwd
     Old password was blank
     I created a new password (it was THAT simple)
    
  2. I created a "etc" directory

  3. I checked the files under /usr/local/mysql/support-files/and saw my cnf file was actually named my-default.cnfand not my-huge.cnflike the developer at the MySQL site.

  4. So I typed: sudo cp my-default.cnf /etc/my.cnf

  5. went back to the Workbench and it FINALLY said:

    Testing host machine settings is done.

  1. 去我的终端并输入:

     passwd
     Old password was blank
     I created a new password (it was THAT simple)
    
  2. 我创建了一个“etc”目录

  3. 我检查了下面的文件/usr/local/mysql/support-files/,发现我的 cnf 文件实际上是命名的,my-default.cnf而不是my-huge.cnfMySQL 站点上的开发人员。

  4. 所以我输入: sudo cp my-default.cnf /etc/my.cnf

  5. 回到工作台,它终于说:

    测试主机设置完成。

回答by Mike Lischke

The MySQL Server installation on OS X does not include a cnf file, so it is normal that you get the warning. Nonetheless you can continue creating the connection without problems (ignore the warning). When you start MySQL Workbench afterwards and try to manage the configuration of the server, you will get another warning, but you can continue and MySQL Workbench creates the cnf file for you. No need to do all that manually.

OS X 上的 MySQL 服务器安装不包含 cnf 文件,因此您收到警告是正常的。尽管如此,您可以继续创建连接而不会出现问题(忽略警告)。当您之后启动 MySQL Workbench 并尝试管理服务器的配置时,您将收到另一个警告,但您可以继续,MySQL Workbench 会为您创建 cnf 文件。无需手动完成所有操作。

回答by user3674318

I met this problem too. I just clicked the continue button until i was at "Review remote management settings" step, and stop here click "change parameters", then continue. At "Path to configuration file" choose the path point to my-default.cnf. Then check path, it works

我也遇到了这个问题。我只是单击了继续按钮,直到进入“查看远程管理设置”步骤,然后在此处停止单击“更改参数”,然后继续。在“配置文件路径”中选择指向 my-default.cnf 的路径。然后检查路径,它的工作原理