Determine the MySQL Version from the Command Line

Last updated: August 27, 2026.

Use the client version command to identify the installed command-line program, and query the server to identify the MySQL instance you actually connected to.

Check the client

mysql --version

Check the connected server

mysql -h 127.0.0.1 -u app_user -p -e "SELECT VERSION() AS server_version;"

The client and server versions can differ. The password prompt avoids placing a password directly in shell history or the process list. Inside an existing MySQL session, run SELECT VERSION();.

admin

admin

Leave a Reply

Your email address will not be published.