Mac OS X,MySQL 首选项窗格不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3027479/
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
Mac OS X, MySQL Preference Pane doesn't work
提问by Steve Kuo
I downloaded and installed MySQL 5.1.47 for OS X 10.6 using the DMG archive:
我使用 DMG 存档下载并安装了适用于 OS X 10.6 的 MySQL 5.1.47:
mysql-5.1.47-osx10.6-x86_64.dmg
I also installed MySQL.prefPane
and MySQLStartupItem.pkg
. MySQL.prefPane
is a Preference Pane. The problem is, whenever I attempt to start/stop MySQL from the Preference Pane, System Preferences just hangs. It runs at about 50% CPU forever, eventually I have for force quit System Preferences. The same thing happens if I toggle "Automatically Start MySQL Server on Startup". Basically the MySQL Preference Pane is not functional.
我也安装MySQL.prefPane
和MySQLStartupItem.pkg
。MySQL.prefPane
是首选项窗格。问题是,每当我尝试从首选项窗格启动/停止 MySQL 时,系统首选项就会挂起。它永远以大约 50% 的 CPU 运行,最终我不得不强制退出系统偏好设置。如果我切换“启动时自动启动 MySQL 服务器”,也会发生同样的事情。基本上 MySQL 首选项窗格不起作用。
Note that I have no problem starting MySQL from the command line:
请注意,我从命令行启动 MySQL 没有问题:
sudo /usr/local/mysql/bin/mysqld_safe
I have tried reinstalling MySQL and the Preference Pane. I'm using the standard installation location, nothing out of the ordinary. Every time the MySQL Preference Pane just hangs.
我尝试重新安装 MySQL 和首选项窗格。我使用的是标准安装位置,没什么特别的。每次 MySQL 首选项窗格都会挂起。
I'm doing this on a Macbook Pro (Intel) running OS X 10.6.3. There are no old versions of MySQL on this machine.
我在运行 OS X 10.6.3 的 Macbook Pro(英特尔)上执行此操作。这台机器上没有旧版本的MySQL。
Follow-up:Well it's now January 2012 so I figure I'd check to see if this has been fixed. I tried the latest MySQL 5.5.20 on OS X 10.6.8 and it's still broken - same behavior, it just hangs (had to force quit). I tried Jamie Wong'sand carloandaya'ssuggestions, both did not work.
跟进:现在是 2012 年 1 月,所以我想我会检查一下是否已修复。我在 OS X 10.6.8 上尝试了最新的 MySQL 5.5.20,但它仍然坏了 - 相同的行为,它只是挂起(不得不强制退出)。我尝试了Jamie Wong和carloandaya 的建议,都没有奏效。
回答by Stephen
Under OS X Lion the following worked for me:
在 OS X Lion 下,以下对我有用:
edit /usr/local/mysql/support-files/mysql.server
编辑 /usr/local/mysql/support-files/mysql.server
change lines ~ 46 & 47
换行 ~ 46 & 47
basedir=
datadir=
to
到
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
回答by Jamie Wong
For anyone still encountering this problem, see: http://bugs.mysql.com/bug.php?id=53232
对于仍然遇到此问题的任何人,请参阅:http: //bugs.mysql.com/bug.php?id=53232
Specifically, here's Rembert Oldenboom's response:
具体来说,这是 Rembert Oldenboom 的回应:
Issue still exists with mysql 5.5.8 on brand new on mbp i7 2.8. With the comments of others the fix was easy:
Edit /usr/local/mysql/support-files/mysql.server Search for "Set some defaults" about 4 lines down, replace the line
basedir=.
with
basedir=/usr/local/mysql
Then search for "Set pid file if not given" about 3 lines down, replace the line
mysqld_pid_file_path=$datadir/`hostname`.pid
with
mysqld_pid_file_path=$datadir/`/bin/hostname`.pid
Now the prefPane will work.
mysql 5.5.8 在 mbp i7 2.8 上的全新版本上仍然存在问题。根据其他人的评论,修复很容易:
编辑/usr/local/mysql/support-files/mysql.server 搜索“Set some defaults”大约4行向下,替换该行
basedir=.
和
basedir=/usr/local/mysql
然后搜索“Set pid file if not given”大约向下3行,替换该行
mysqld_pid_file_path=$datadir/`主机名`.pid
和
mysqld_pid_file_path=$datadir/`/bin/hostname`.pid
现在 prefPane 将工作。
回答by Isto Barton
old stack overflow post! The world has changed a great deal, and I wanted to share my solution to this problem. The issue for me was the time zone tables AND Stephen's answers.
旧堆栈溢出帖子!世界发生了很大变化,我想分享我对这个问题的解决方案。我的问题是时区表和斯蒂芬的答案。
I did:
我做了:
edit /usr/local/mysql/support-files/mysql.server
change lines ~ 46 & 47
basedir= datadir=
to
basedir=/usr/local/mysql datadir=/usr/local/mysql/data
编辑 /usr/local/mysql/support-files/mysql.server
换行 ~ 46 & 47
basedir=数据目录=
到
basedir=/usr/local/mysql datadir=/usr/local/mysql/data
AND updated my my.cnf.
并更新了我的 my.cnf。
I had a default-time-zone set to UTC. I had to comment out that line.
我将默认时区设置为 UTC。我不得不注释掉那行。
default-time-zone = UTC
to
到
# default-time-zone = UTC
# default-time-zone = UTC
Start server using plist file (check your plist path/name!):
使用 plist 文件启动服务器(检查您的 plist 路径/名称!):
sudo launchctl load -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl load -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
I then loaded MySQL time zone tables from Mac OS time zone files:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root --password="YOUR_PASSWORD_HERE" mysql
I then stopped MySQL and restarted using my plist file.
然后我停止了 MySQL 并使用我的 plist 文件重新启动。
sudo launchctl unload -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl unload -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl load -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl load -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
After that, I was able to stop/start using the preference panel!
之后,我可以停止/开始使用首选项面板!
回答by carloandaya
I've installed and re-installed MySQL 5.5.15 using some of the tips that I found on the net. I found that selecting "install for all users of this machine" rather than "install only for current user" after double-clicking the preferences pane installation from the .dmg file makes it work. It's the only step that I changed in my many installations of MySQL on Snow Leopard.
我已经使用我在网上找到的一些技巧安装并重新安装了 MySQL 5.5.15。我发现在双击 .dmg 文件中的首选项窗格安装后,选择“为这台机器的所有用户安装”而不是“仅为当前用户安装”可以使其工作。这是我在 Snow Leopard 上的许多 MySQL 安装中更改的唯一步骤。
回答by dzen
Are you sure that panther supports 64 bits apps ?
您确定 panther 支持 64 位应用程序吗?
Seems that when a I'm trying to open a 32 bits preference pane on snow leopard, the preference pane says "well this pane is 32bits, and you've got a 64bits macos, I'm restarting this pane"
似乎当我试图在雪豹上打开一个 32 位的首选项窗格时,首选项窗格说“这个窗格是 32 位的,而你有一个 64 位的 macos,我正在重新启动这个窗格”
Maybe it's hanging because it's the opposite ? getting 32bits preference pane and trying to open a 64bits pane ?
也许它挂了,因为它是相反的?获取 32 位首选项窗格并尝试打开 64 位窗格?
回答by hawk
Other solutions here didn't work for me, but I cobbled together my own solution with the help of this bug ticket: https://bugs.mysql.com/bug.php?id=28854(specifically the comment by BuB Javier)
这里的其他解决方案对我不起作用,但我在这个错误票的帮助下拼凑了我自己的解决方案:https: //bugs.mysql.com/bug.php?id=28854(特别是 BuB Javier 的评论)
The trick was twofold:
诀窍是双重的:
Create a /bin/pidoffile using the code from http://www.cs.cmu.edu/~benhdj/Mac/unix.html
#!/bin/sh ps axc|awk "{if ($5==\"\") print $1}"|tr '\n' ' '
Make sure it's executable.
- Create a /etc/my.confor ~/.my.conffile with the
pid-file
option specifying the path to the PID file (e.g. /usr/local/mysql/data/`hostname`.pid). (This is easy to do within MySQLWorkbench.)
I discovered this after trying to stop the server in MySQLWorkbench and it throwing "PID file not found!" error messages. Apparently specifying the pid-file location in the mysql.server file doesn't work.
使用来自http://www.cs.cmu.edu/~benhdj/Mac/unix.html的代码创建一个/bin/pidof文件
#!/bin/sh ps axc|awk "{if ($5==\"\") print $1}"|tr '\n' ' '
确保它是可执行的。
- 创建一个/etc/my.conf或~/.my.conf文件,其中包含
pid-file
指定 PID 文件路径的选项(例如/usr/local/mysql/data/`hostname`.pid)。(这在 MySQLWorkbench 中很容易做到。)
我在尝试停止 MySQLWorkbench 中的服务器并抛出“找不到 PID 文件!”后发现了这一点。错误信息。显然在 mysql.server 文件中指定 pid 文件位置不起作用。
I did change some permissions to _mysql:wheel here and there as frequently suggested, but I'm not sure that mattered in my case. After doing the two steps above, the preference pane was working again. If it doesn't work for you, try changing some file permissions.
我确实按照经常建议的方式在这里和那里更改了 _mysql:wheel 的一些权限,但我不确定这对我的情况是否重要。完成上述两个步骤后,首选项窗格又可以正常工作了。如果它不适合您,请尝试更改一些文件权限。
MySQL 5.6.25 Community Server (64bit)
Mac OS X Mavericks (10.9.5)
MySQL 5.6.25 社区服务器(64 位)
Mac OS X Mavericks (10.9.5)
回答by Takide
I had this problem too. It turned out that I installed the 32 bit MySQL server on my 64 bit Mac on accident. Woops! I would recommend verifying your processor type (32 or 64 bit) and reinstalling the according MySQL DMG.
我也有这个问题。结果是我在我的 64 位 Mac 上意外安装了 32 位 MySQL 服务器。哇!我建议验证您的处理器类型(32 或 64 位)并重新安装相应的 MySQL DMG。
It took me a couple of days to figure this out! MySQL was still running fine in the background, it's just the preference pane and connecting to it via terminal that would not work.
我花了几天时间才弄明白这个!MySQL 在后台仍然运行良好,它只是首选项窗格并无法通过终端连接到它。
I hope this works for you!
我希望这对你有用!
回答by Tarun Gupta
This worked for me :
这对我有用:
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Problem I recognised was of permission to mysql.server
我认识到的问题是对 mysql.server 的许可