Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
Hi keithosu - for some reason i didn't see your post before I clicked "answer my own question". Gonna give you the answer though since that would've fixed the problem for me! –  Matt Aug 26 '09 at 20:41

Okay - found the problem. The mysql configuration file (/etc/my.cnf) was set to bind a different IP address than the one currently assigned to the network device. I changed it to bind the current address, and got it working again. The tip-off was that it couldn't bind 3306, even though I couldn't find anything anywhere using it.

share|improve this answer

have you check a netstat output ?

netstsat -n -p tcp | grep 3306

to see if there is a program already listening on the mysql port ?

share|improve this answer
    
Just did - nothing is on 3306 (or 3307 which I also tried to start mysqld on) –  Matt Aug 26 '09 at 20:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.