Easiest way is probably using command status; In the output you'll find database, user, host and port:
mysql> status;
--------------
mysql Ver 8.0.13 for Win64 on x86_64 (MySQL Community Server - GPL)
Connection id: 43
Current database: mysql
Current user: user@localhost
SSL: Cipher in use is DHE-RSA-AES128-GCM-SHA256
Using delimiter: ;
Server version: 8.0.13 MySQL Community Server - GPL
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: cp852
Conn. characterset: cp852
TCP port: 3306
Uptime: 3 hours 32 min 40 sec
Threads: 3 Questions: 197 Slow queries: 0 Opens: 214 Flush tables: 2 Open tables: 190 Queries per second avg: 0.015
--------------