So for determining a listener on a port, do this
You should see a line that seems like this if MySQL is indeed listening on that port.
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
Port 3306 is the MySQL's default port.
In order, to connect, you simply have to use any client you need, such as the basic MySQL client.
mysql -h localhost -u user database
Or a URL which is defined by your library code.
Want to become a SQL Expertise? Join the SQL Course and get certified.