Determine version locally / with access
Determine version remotely
nmap -sV -p 3306 addressOfMachine
nc -w 1 addressOfMachine 3306
With netcat you may see weird output, example is below
nc -w 1 192.168.1.1 3306
In this case the version is 4.1.20, so you’ll have to read through the mess that is netcat output.