check mysql port code example
Example 1: check mysql port
mysql -u root
mysql> SHOW GLOBAL VARIABLES LIKE 'PORT';
# Default port is 3306 for MySQL
Example 2: netstat -tln mysql
lsof -n -P -i TCP -s TCP:LISTEN
mysql -u root
mysql> SHOW GLOBAL VARIABLES LIKE 'PORT';
# Default port is 3306 for MySQL
lsof -n -P -i TCP -s TCP:LISTEN