7

Okay guys, I'm ready to bloody give up on this thing, I think I'm almost there though, just one last error, the server starts up fine, but then it fails saying that the bind on TCP/IP port already in use :S Which is not true, as mysql is not running :(

Errors:

bash-4.2$ mysqld
120730 18:31:05 [Note] Plugin 'FEDERATED' is disabled.
120730 18:31:05 InnoDB: The InnoDB memory heap is disabled
120730 18:31:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120730 18:31:05 InnoDB: Compressed tables use zlib 1.2.5
120730 18:31:05 InnoDB: Using Linux native AIO
120730 18:31:05 InnoDB: Initializing buffer pool, size = 128.0M
120730 18:31:05 InnoDB: Completed initialization of buffer pool
120730 18:31:06 InnoDB: highest supported file format is Barracuda.
120730 18:31:06  InnoDB: Waiting for the background threads to start
120730 18:31:07 InnoDB: 1.1.8 started; log sequence number 2929794
120730 18:31:07 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120730 18:31:07 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
120730 18:31:07 [Note] Server socket created on IP: '0.0.0.0'.
120730 18:31:07 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
120730 18:31:07 [ERROR] Do you already have another mysqld server running on port: 3306 ?
120730 18:31:07 [ERROR] Aborting

120730 18:31:07  InnoDB: Starting shutdown...
120730 18:31:08  InnoDB: Shutdown completed; log sequence number 2929794
120730 18:31:08 [Note] mysqld: Shutdown complete
octern
  • 4,825
  • 21
  • 38
Conner Stephen McCabe
  • 581
  • 4
  • 10
  • 20
  • run `ps ax | fgrep mysql` & verify that it is or is not... somethings running. – Richard Sitze Jul 30 '12 at 16:39
  • This might help identify the process bound to the port: http://blog.kagesenshi.org/2006/07/finding-what-process-is-binding.html – Richard Sitze Jul 30 '12 at 16:39
  • `lsof` is usually the best for finding this kind of trouble. – tadman Jul 30 '12 at 17:38
  • I had this issue and discovered that during and upgrade rackspace had removed the 'lo' network interface (meaning that the ip addres 127.0.0.1 doesn't connect), this can be easily check by running 'ping 127.0.0.1' or running 'ifconfig' and checking for the lo localhost loopback network interface. – Omn May 27 '16 at 03:32
  • try : sudo service mysql stop – Abdullah Tahan Oct 17 '19 at 10:13

1 Answers1

13

Use lsof -i TCP:3306 or netstat -lp | grep 3306 to find out what is already listening on port 3306 - something must be listening on it.

You could consider staring the server on a different port (edit my.cnf and change the default port there).

You may need to run this as root, i.e. sudo lsof -i TCP:3306

Richard Harrison
  • 19,247
  • 4
  • 40
  • 67