1

Like many other posts I tried to switch my MAMP MySQL port from 8889 to 3306 and I am getting the following error in the sql log

2016-10-26 16:02:18 9681 [Note] Server hostname (bind-address): '*'; port: 3306
2016-10-26 16:02:18 9681 [Note] IPv6 is available.
2016-10-26 16:02:18 9681 [Note]   - '::' resolves to '::';
2016-10-26 16:02:18 9681 [Note] Server socket created on IP: '::'.
2016-10-26 16:02:18 9681 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
2016-10-26 16:02:18 9681 [ERROR] Do you already have another mysqld server running on port: 3306 ?

I checked Active Monitor for mysqlld (as suggested here setting mamp ports to 80 and 3306). No processes where running

I also tried lsof -i:3306 , which returns nothing.

I also tried a different port, and it is working, so the problem is not with MAMP but with the specific port.

I tried to check for pid in my terminal (as suggested here MAMP - mysql server won't start on port 3306 was found

Tried to restart, and did not work either

which mysql -> /Applications/MAMP/Library/bin/mysql

I do find another mysql installed under /usr/local/mysql, but it seems to be not in use.

I did try

/usr/local/mysql/support-files/mysql.server stop
 ERROR! MySQL server PID file could not be found

and I do see

ps aux | grep mysqld
_mysql             100   0.0  1.0  2889832 171596   ??  Ss    2:59PM   0:01.80 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/mysqld.local.err --pid-file=/usr/local/mysql/data/mysqld.local.pid

but this is being added every time I try to start the server on mamp What else am I missing?

Community
  • 1
  • 1
Quantico
  • 2,398
  • 7
  • 35
  • 59
  • Have you checked 3306 port on your server to see if it's in use by other applications or not? – EhsanT Oct 26 '16 at 20:23
  • It is a fresh installation of MAMP, so I doubt anything will be using it. – Quantico Oct 26 '16 at 20:24
  • also netstat -p tcp | grep 3306 returns with no results – Quantico Oct 26 '16 at 20:25
  • I'm not a mac user, but I'm not talking about MAMP, I'm talking about other applications which may be installed on your computer which have occupied 3306 port. can you check if this port is free on your server? – EhsanT Oct 26 '16 at 20:25
  • ok then, have you tried for example 3307 port? does the server start on any other given port except 3306? – EhsanT Oct 26 '16 at 20:26
  • Yes it starts on any other port, but I do need to use the 3306 option, otherwise I would just use a different port – Quantico Oct 26 '16 at 20:27
  • in [this post](http://stackoverflow.com/questions/24426227/mamp-mysql-server-wont-start-on-port-3306) they say you can use this command `lsof -i:3306` to check for processes listening on the port 3306. have you tried this? – EhsanT Oct 26 '16 at 20:30
  • I did, nothing is listening (will update the question to show this as well) – Quantico Oct 26 '16 at 20:31
  • have you seen these two posts? [post1](http://serverfault.com/questions/59232/cant-get-mysqld-started-on-osx-server-was-working-before), [post2](http://stackoverflow.com/questions/11725737/mysql-daemon-refuses-to-start-with-cant-start-server-bind-on-tcp-ip-port-add) – EhsanT Oct 26 '16 at 20:45
  • Yes for post2, both return nothing. adding a my.cnf, did not solve it either. – Quantico Oct 27 '16 at 12:32
  • Have you solved this problem ? – Varun Naharia May 18 '18 at 06:25

0 Answers0