-1

I am using ubuntu Jammy release and on my system port no 3306 is unusable since I tried ssh based port forwarding on the same to a different machine. Also while running ps -aux it shows a strage process for mysqld with pid 2336 which I havent installed locally.

It doesnt allow me to kill the process as normal user. When I kill with sudo it simply restarts this process again. Even on machine restart this process shows up on its own.

It seems to me that this process is started by SSH deamon. One reason I think so is absence of process path in the last column. Any ideas how I can stop this ?

enter image description here

Gautam
  • 111
  • 1
    Looks like Mysql or Mariadb is installed, plus mysql-workbench. Before you remove these, consider that they might have been installed as part of software that requires database services. Nothing in your output indicates that SSH is involved. – berndbausch May 29 '23 at 04:52
  • 1
    the systemd+ in the first column suggests it's systemd that is starting that process and keeping ti going after you kill it ... systemctl status mysqld may shed some light on your lack of understanding – Jaromanda X May 29 '23 at 05:17
  • 1
  • there was no easy way to copy the whole thing @Kusalananda – Gautam May 29 '23 at 06:36
  • @JaromandaX as I mentioned there is no local mysqld installation. I use mysqlworkbench and connect to remote mysql server or local docker based installations. So as expected systemctl status mysqld throws message Unit mysqld.service could not be found. – Gautam May 29 '23 at 06:39
  • the service may not be called mysqld.service ... that was a guess on my part ... I would bet that it is some systemd service though - pretty easy to find out what service it is though – Jaromanda X May 29 '23 at 06:51

1 Answers1

1

Long story short, you have MySQL installed and running. This may have been done without you noticing, for example I believe some local file indexing on Ubuntu uses it.

Find the installed systemd units:

systemctl list-unit-files | grep -e maria -e MySQL

Find what process is actually keeping the file open:

netstat -antpl |grep "3306.*LISTEN"

Look for MySQL config:

ls /etc/my.cnf
grep include /etc/my.cnf

On a side note: Don't use kill -9 unless you have no other way to do it. SigKILL should never ever ever be your default. See also When should I not kill -9 a process?

Kusalananda
  • 333,661
Johan
  • 4,148
  • Your pointers are helpful. Running netstat showed a docker proxy instance that was occupying the port and stopping and removing the container fixed the problem. – Gautam May 29 '23 at 08:22
  • Interestingly I did think about containers briefly but dismissed the idea. – Johan May 29 '23 at 08:32