ktgnair.github.io

Follow me on GitHub

Things in Mysql / Check user privileges / Create new user and give privileges / Different operations in MySQL / Reset root password

To check which port is used by MySQL.

Type the following in your terminal.

INPUT:      
sudo netstat -tlnp  
OUTPUT:   
Active Internet connections (only servers)  
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1019/mysqld           
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      965/systemd-resolve  
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      1821/vino-server    
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      753/cupsd           
tcp6       0      0 :::5355                 :::*                    LISTEN      965/systemd-resolve   
tcp6       0      0 :::5900                 :::*                    LISTEN      1821/vino-server    
tcp6       0      0 ::1:631                 :::*                    LISTEN      753/cupsd           

Here first line’s last column tells us that it’s MySQL,
Check the local address of the line it will and it will tell us that the port no 3306 is being used.