Mysql – Can’t get thesqld started on OSX server – was working before

mac-osxMySQL

We had a web app running on an OSX server backed by mysql. The server is running Darwin kernel 9.8.0. Mysql version is 5.0.67.

It was working fine previously, and we're not entirely sure what might have changed. The computer has since been rebooted to see if it would start mysql. Unfortunately, this means that I can't tell you if it was erroneously rebooted by another user before that, and that caused the problem.

The errors I am getting are:

/usr/libexec/mysqld: File './mysql-bin.124367' not found (Errcode: 13)
090826 14:42:50 [ERROR] Could not use mysql-bin for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.

That file it couldn't find really does exist … So, I turned off logging in the my.cnf to see what else might be happening. Now the error I get is:

090826 14:52:16 [ERROR] Can't start server: Bind on TCP/IP port: Can't assign requested address
090826 14:52:16 [ERROR] Do you already have another mysqld server running on port: 3306 ?

I did a ps -Aef | grep mysql and found no other running daemons. With ifconfig I saw that the loopback device was in fact up. I tried binding mysqld to a different port (3307), but got the same error (but for 3307).

I've tried starting mysqld as root. I've tried starting it passing in the arguments –user=_mysql.

I can't figure out what else to try. Any suggestions?

EDIT: @nambuls: netstat -n -p tcp | grep 3306 returns nothing.

EDIT2: the error log also shows warnings – I didn't post before since they were just "warnings", but it might help.

090826 15:16:02 [Warning] Can't create test file /var/mysql/tanglewood.lower-test
090826 15:16:02 [Warning] Can't create test file /var/mysql/tanglewood.lower-test

I'm not sure why it can't create the test file – /var/mysql is 775 for _mysql:admin, and I started the process as admin.

Best Answer

try adding this to you my.cnf file:

  [mysqld]
  bind-address      = 127.0.0.1

Note that this will only allow local mysql connections. If you are running your webserver on the same host this bind-address will be fine for your setup.

If the 127.0.0.1 works, you may try the systems IP address. bind-address should not normally be required.