Skip to content

Fix "Port is already in use"

Starting an instance fails with this message when its port is busy:

Port 5432 is already in use. Change this instance's port and try again.

Either change the instance’s port or stop whatever uses it.

  1. Stop the instance. The port cannot change while it runs (“stop the instance before changing its port”).
  2. Change its port to a free number from 1024 to 65535 that no other instance uses.
  3. Start it again. Update your app’s configuration to the new port.

See ports.

macOS:

Terminal window
lsof -nP -iTCP:5432 -sTCP:LISTEN

Linux:

Terminal window
ss -ltnp | grep :5432

Windows (Command Prompt):

Terminal window
netstat -ano | findstr :5432

Replace 5432 with your port (3306 for MySQL). The last column on Windows is the process id.

Is it another SQLEye instance or a system database?

Section titled “Is it another SQLEye instance or a system database?”

A system-wide PostgreSQL or MySQL, or another instance, often holds the default ports 5432 and 3306. When you create an instance, SQLEye suggests the next free port above the default.

SQLEye is developed and maintained by CodeROG. This page is also available as Markdown.