开发者

Error in starting MySQL in Mac OS X 10.6

i am trying to run MySQL 5.5.8 in my Mac OS X 10.6 (Snow Leopard). I'm calling /usr/local/mysql/bin/mysqld_safe and I get this in the error log...

110124 16:35:36 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.5.8-osx10.6-x86_64/data
110124 16:35:36 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql-5.5.8-osx10.6-x86_64/data/ is case insensitive
110124 16:35:36 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
110124 16:35:36  InnoDB: Initializing buffer pool, size = 128.0M
110124 16:35:36  InnoDB: Completed initialization of buffer pool
110124 16:35:36  InnoDB: highest supported file format is Barracuda.
110124 16:35:36  InnoDB: 1.1.4 started; log sequence number 2809411
110124 16:35:36 [ERROR] Can't start server : Bind on unix socket: Permission denied
110124 16:35:36 [ERROR] Do you already have another mysqld server running on socket: /var/mysql/mysql.sock ?
110124 16:35:36 [ERROR] Aborting

110124 16:35:36  InnoDB: Starting shutdown...
110124 16:35:38  InnoDB: Shutdown completed; log sequence 开发者_开发技巧number 2809411
110124 16:35:38 [Note] /usr/local/mysql-5.5.8-osx10.6-x86_64/bin/mysqld: Shutdown complete

110124 16:35:38 mysqld_safe mysqld from pid file /usr/local/mysql-5.5.8-osx10.6-x86_64/data/MyMacPro.local.pid ended

Here is what I have in /etc/my.cnf... wondering if I need to add more settings.

[client]
socket = /var/mysql/mysql.sock

[mysqld]
socket = /var/mysql/mysql.sock

Thank you so much, Robert


110124 16:35:36 [ERROR] Can't start server : Bind on unix socket: Permission denied

We did the following just now with MySQL 5.5.28 that fixed the bind problem for us. It is necessary because the sock file is written here:

sudo chown -R _mysql /var/lib/mysql

We also did the following although I'm not sure that it was necessary:

sudo chown -R _mysql /usr/local/mysql 


$ sudo cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf
$ sudo /usr/local/mysql/support-files/mysql.server start
Starting MySQL
.... SUCCESS!

This done it for me!


From what I remember, Mac OS X's /var/mysql will be owned by root by default, so there are two solutions to this problem.

  1. Start mysql as root by prepending your command with sudo, e.g. sudo /usr/local/mysql/bin/mysqld_safe
  2. Or change the /var/mysql directory to be owned by yourself, since you're running the mysqld_safe command. This would be done as follows: sudo chmod -R yourusername:yourgroup /var/mysql

Hope this helps!


I experienced the same problem. Something went wrong with my installation via mac ports.

Can't start server : Bind on unix socket: Permission denied

Do you already have another mysqld server running on socket: /opt/local/var/run/mysql5/mysqld.sock ?

Check if you can read/write to /opt/local/var/run/mysql5/ with the mysql user:

sudo -u mysql touch /opt/local/var/run/mysql5/test
sudo -u mysql ls l /opt/local/var/run/mysql5

If not, check the permissions in the parent folders. In my case /opt/local/var/run had strange permissions 730 (drwx-w----) but should have been 755.


You could install the MySQL Preference Pane, as detailed here. This would allow you to control MySQL without root privileges.


looks like you are executing this as normal user. Run the same command using sudo and then following the command you are using.


There is some problem in mysql 5.5.8 installation on MAC snow leopard,you can use mysql 5.1.56 instead & it works fine for me.The complete installation steps are mentioned here on this blog http://mysqlonsnowleopard.blogspot.com/ just follow the steps & it works


We've document installing MySQL and PHPMyAdmin in Mac OS X here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜