Many responses advise using mysql —version. But the client is the MySQL software. Mysqld is the server. The command should therefore be:
mysqld --version
or
mysqld --help
On both Windows and Debian, that works for me.
When using a client to connect to a MySQL server, you can utilize:
select version()
or
select @@version
I hope this helps you.