I downloaded and installed MySQL 5.1.47 for OS X 10.6 using the DMG archive:
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.
Note that I have no problem starting MySQL from the command line:
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.
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.
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's and carloandaya's suggestions, both did not work.
Under OS X Lion the following worked for me:
edit /usr/local/mysql/support-files/mysql.server
change lines ~ 46 & 47
basedir=
datadir=
to
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
For anyone still encountering this problem, see: http://bugs.mysql.com/bug.php?id=53232
Specifically, here's Rembert Oldenboom's response:
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.
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
AND updated my my.cnf.
I had a default-time-zone set to UTC. I had to comment out that line.
default-time-zone = UTC
to
# default-time-zone = UTC
Start server using plist file (check your plist path/name!):
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.
sudo launchctl unload -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!
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.
Are you sure that panther supports 64 bits apps ?
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"
Maybe it's hanging because it's the opposite ? getting 32bits preference pane and trying to open a 64bits pane ?
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.
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.
I hope this works for you!
This worked for me :
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Problem I recognised was of permission to mysql.server
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)
The trick was twofold:
Create a /bin/pidof file using the code from http://www.cs.cmu.edu/~benhdj/Mac/unix.html
#!/bin/sh ps axc|awk "{if (\$5==\"$1\") print \$1}"|tr '\n' ' '
Make sure it's executable.
- Create a /etc/my.conf or ~/.my.conf file 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.
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 5.6.25 Community Server (64bit)
Mac OS X Mavericks (10.9.5)
精彩评论