MySQL Workbench“正在获取..."-- 无法浏览数据库

2022-01-14 00:00:00 macos xampp mysql

我最近遇到了很多问题,基本上是自从我上次升级 XAMPP for OSX (v1.7.3) 和/或我的 MySQL GUI 工具以来.使用 MySQL Workbench (v5.2.44),我可以很好地连接到在 XAMPP 中运行的数据库,但尝试浏览任何数据库,在表/视图/等下,它只显示Fetching...",从不显示其他任何内容.我实际上可以查询表,这很有趣,但我实际上无法以任何有意义的方式管理数据库.

I've been having a lot of issues lately, basically since the last time I upgraded XAMPP for OSX (v1.7.3) and/or my MySQL GUI tools. Using MySQL Workbench (v5.2.44), I can connect to the DB running in XAMPP just fine, but trying to browse any database, under tables/views/etc it only shows "Fetching..." and never shows anything else. I can actually query tables, which is interesting, but I can't actually manage the databases in any meaningful way.

谷歌搜索,其他报告说运行mysql_upgrade 在命令行上运行良好,但没有解决我的问题.

Googling, others reported having luck running mysql_upgrade on the command line, which ran fine but did not fix my issue.

推荐答案

上面的 mysql_upgrade 链接并没有直接解决我的问题,但它确实让我检查了我的mysql错误文件,最终引导我找到解决方案.我注意到错误文件中有几行这样的行(位于 [xampp root]/var/mysql/[dbname].err):

The link above to mysql_upgrade did not solve my problem directly, but it did lead me to examine my mysql error file, which ultimately led me to the solution. I noticed several lines like this in the error file (located at [xampp root]/var/mysql/[dbname].err):

/Applications/XAMPP/xamppfiles/sbin/mysqld: Can't create/write to file 
    '/var/folders/y2/37h93r_931sdfpcr7vnc83380000gn/T/ibigNFFi' (Errcode: 13)

这导致我在这个页面MySQL 文档指出您应该为 MySQL 显式设置临时文件夹.我仔细检查了我的配置文件([xampp root]/etc/my.cnf)并看到了这个,看起来不错:

That led me to this page in the MySQL docs which states that you should explicitly set the temp folder for MySQL. I double-checked my config file ([xampp root]/etc/my.cnf) and saw this, which looked fine:

[mysqld]
tmpdir = /Applications/XAMPP/xamppfiles/temp/

不过,回头看错误日志,我也注意到了这一点:

However, looking back at the error log, I also noticed this:

Warning: World-writable config file '/Applications/XAMPP/xamppfiles/etc/my.cnf' is ignored

呃.配置文件被忽略了,所以配置的临时文件夹没有被使用(我不知道为什么该文件是世界可写的......).我编辑了 my.cnf 文件的权限,该文件是 777,并简单地删除了Everyone|write"权限(现在是 775/-rwxrwxr-x),重新加载了所有内容,现在一切正常.

Duh. The config file was getting ignored, so the configured temp folder was not getting used (I have no clue why the file was world-writeable...). I edited permissions on the my.cnf file which was 777 and simply removed the "Everyone|write" permission (now 775 / -rwxrwxr-x), reloaded everything, and now everything works.

对于最终修复而言,这不是一个非常直观的症状,因此希望这对其他人有所帮助.

Not a very intuitive symptom for the ultimate fix, so hopefully this helps someone else.

相关文章