What service is using this port?

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
kardo
Level 1
Level 1
Posts: 5
Joined: Thu Apr 16, 2015 8:16 pm

What service is using this port?

Post by kardo » Sat Dec 31, 2016 9:29 am

I'm using Linux Mint 17.1, 64-bit.

Still very much new to it as I've not dabbled much in the Terminal and have been finding things in these forums and online to muddle my way through. But after hours trying to figure this one out, it still has me stumped.

It looks like something else, which I can't identify, is using port 3306, which I need for a new install of LAMPP.

Tried doing it quite a few months back, it didn't work, and back then I didn't need it badly enough to spend the time trying to figure out why. In another user account, I installed it again today but MariaDB (which apparently replaces MySQL, although the terminology seems almost interchangeable) won't start.

The error log gives me this:

2016-12-31 20:43:05 139998375688064 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 98: Address already in use
2016-12-31 20:43:05 139998375688064 [ERROR] Do you already have another mysqld server running on port: 3306 ?

In the Terminal, I used $ sudo netstat -tunap | grep LISTEN to produce this output:

tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 880/smbd
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 1652/dnsmasq
tcp 0 0 127.0.0.1:4822 0.0.0.0:* LISTEN 2264/guacd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1580/postgres
tcp 0 0 0.0.0.0:538 0.0.0.0:* LISTEN 2246/gdomap
tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 2393/dropbox
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 880/smbd
tcp 0 0 127.0.0.1:17600 0.0.0.0:* LISTEN 2393/dropbox
tcp 0 0 127.0.0.1:17603 0.0.0.0:* LISTEN 2393/dropbox
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 12450/mysqld
tcp6 0 0 :::139 :::* LISTEN 880/smbd
tcp6 0 0 :::17500 :::* LISTEN 2393/dropbox
tcp6 0 0 :::445 :::* LISTEN 880/smbd

The port I need is there, 4 lines from the bottom, but it's not LAMPP using it because MySQL/MariaDB was already stopped.

I have uninstalled and re-installed repeatedly, restarted the computer, same result. In case I've been doing that wrong and making things worse, the command I've been using to uninstall is:
sudo rm -rf /opt/lampp

I have no idea how to identify the service that is using typing up port 3306. Is there a way to find this out? (and then I can do something about stopping it!)

My apologies for the bad formatting of the quoted stuff, this is only my 2nd ever post, but I will be grateful for any help I can get.
Last edited by kardo on Sat Dec 31, 2016 10:35 pm, edited 2 times in total.

User avatar
richyrich
Level 19
Level 19
Posts: 9075
Joined: Mon May 04, 2009 8:31 pm

Re: What service is using this port?

Post by richyrich » Sat Dec 31, 2016 10:16 am

I can't help with the ports, but this is NOT the way to un-install anything . . all this command does is delete !
sudo rm -rf /opt/lampp

fungus
Level 4
Level 4
Posts: 381
Joined: Mon Sep 07, 2015 6:09 am

Re: What service is using this port?

Post by fungus » Sat Dec 31, 2016 10:30 am

3306 is usually a MySQL port.

EDIT: In a terminal try to "kill mysqld" and see if the port is still in use. In order to completely rid yourself of MySQL you should purge packages "mysql-client", "mysql-server" and "mysql-common".
Linux Mint 17.3 64bit KDE @ Asus B150M-A, i3 6100, Crucial 16GB DDR4, Crucial BX100
One bit says: YES, the other answers: NO.. Guess who's he and who's she..! ;)

kardo
Level 1
Level 1
Posts: 5
Joined: Thu Apr 16, 2015 8:16 pm

Re: What service is using this port?

Post by kardo » Sat Dec 31, 2016 10:53 am

@fungus, when I try "kill mysqld" I get this:

bash: kill: mysqld: arguments must be process or job IDs

fungus
Level 4
Level 4
Posts: 381
Joined: Mon Sep 07, 2015 6:09 am

Re: What service is using this port?

Post by fungus » Sat Dec 31, 2016 11:06 am

kardo wrote:@fungus, when I try "kill mysqld" I get this:

bash: kill: mysqld: arguments must be process or job IDs
Sorry, you need the process ID of mysqld (ps -A | grep mysqld) - the first column holds the process ID which can be used to kill the process :)
Linux Mint 17.3 64bit KDE @ Asus B150M-A, i3 6100, Crucial 16GB DDR4, Crucial BX100
One bit says: YES, the other answers: NO.. Guess who's he and who's she..! ;)

kardo
Level 1
Level 1
Posts: 5
Joined: Thu Apr 16, 2015 8:16 pm

Re: What service is using this port?

Post by kardo » Sat Dec 31, 2016 11:54 am

thank you, that did it! Looks like it's all working the way it should.

[Edit] That was yesterday. Today, after restarting my computer, it's misbehaving again. :(

I keep using the "kill" command, but each time, a fresh process ties up the port. Even after I shut down everything on my screen except the one terminal, where I'm putting in the commands to identify the process and kill it, it comes up with a fresh process using the port.

Post Reply

Return to “Software & Applications”