简体   繁体   English

MySQL Workbench“正在获取...”——无法浏览数据库

[英]MySQL Workbench "fetching..." -- cannot browse DB

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.我最近遇到了很多问题,基本上是自上次升级 XAMPP for OSX (v1.7.3) 和/或我的 MySQL GUI 工具以来。 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.使用MySQL Workbench (v5.2.44),我可以很好地连接到在 XAMPP 中运行的数据库,但是尝试浏览任何数据库时,在表/视图/等下它只显示“正在获取...”并且从不显示任何其他内容。 I can actually query tables, which is interesting, but I can't actually manage the databases in any meaningful way.我实际上可以查询表,这很有趣,但我实际上无法以任何有意义的方式管理数据库。

Googling, others reported having luck running mysql_upgrade on the command line, which ran fine but did not fix my issue.谷歌搜索, 其他人报告说在命令行上运行mysql_upgrade幸运,它运行良好但没有解决我的问题。

The following command worked for me on windows:以下命令在 Windows 上对我有用:

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql_upgrade.exe -u root -p --force C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql_upgrade.exe -u root -p --force

If the root password is not set, you might need to do this before you run the command above:如果未设置 root 密码,您可能需要在运行上述命令之前执行此操作:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('something'); mysql> 为 'root'@'localhost' 设置密码 = PASSWORD('something');

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.上面指向mysql_upgrade的链接并没有直接解决我的问题,但它确实引导我检查了我的 mysql 错误文件,最终引导我找到了解决方案。 I noticed several lines like this in the error file (located at [xampp root]/var/mysql/[dbname].err ):我注意到错误文件(位于[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)

That led me to this page in the MySQL docs which states that you should explicitly set the temp folder for MySQL.这让我看到了 MySQL 文档中的这个页面,其中指出您应该为 MySQL 明确设置临时文件夹。 I double-checked my config file ( [xampp root]/etc/my.cnf ) and saw this, which looked fine:我仔细检查了我的配置文件 ( [xampp root]/etc/my.cnf ) 并看到了这个,看起来不错:

[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

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.我编辑了my.cnf文件的权限,它是 777,只是删除了“Everyone|write”权限(现在是 775 / -rwxrwxr-x),重新加载了所有内容,现在一切正常。

Not a very intuitive symptom for the ultimate fix, so hopefully this helps someone else.最终修复不是一个非常直观的症状,所以希望这对其他人有帮助。

If you have MAMP instead of XAMP the solution above won't work for you.如果您使用的是 MAMP 而不是 XAMP,则上述解决方案对您不起作用。 Open MAMP then on the top menu go to Tools->Upgrade MySQL databases.打开 MAMP,然后在顶部菜单中转到“工具”->“升级 MySQL 数据库”。 Now open Mysql Workbench and it should list all your tables correctly现在打开 Mysql Workbench,它应该会正确列出所有表

If you are using linux distro the run following command:如果您使用的是 linux 发行版,请运行以下命令:

mysql_upgrade -u root -p

I set Authenticated Users with all privileges to the var/folders/y2/ For me work fine;)我将经过身份验证的用户设置为对 var/folders/y2/ 拥有所有权限,对我来说工作正常;)

Before the process I removed authenticated users privileges.在此过程之前,我删除了经过身份验证的用户权限。

Close and reopen Workbench.关闭并重新打开工作台。 it worked for me.它对我有用。

Stop server.停止服务器。

close workbench window关闭工作台窗口

start server启动服务器

open workbench window打开工作台窗口

worked for me.. windows 64bit为我工作.. windows 64bit

I had that error with MySQL 8, win10.我在 MySQL 8、win10 上遇到了这个错误。 I've noticed that this line Where the error was我注意到错误所在的这一行

Was leading to another directory trying to find the my.ini file.导致另一个目录试图找到 my.ini 文件。 Looked for it, found it in that directory, changed it.寻找它,在该目录中找到它,然后更改它。 Opened Workbench, clik on every item that was in gray, and turned it into black and that's it!!打开 Workbench,点击灰色的每个项目,然后将其变成黑色,就是这样!! Ok now!!现在没事了!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM