How to Check MySQL Version in Windows - Complete Guide

Mahesh Mahesh Waghmare
4 min read

Checking MySQL version is essential for compatibility, troubleshooting, and ensuring you’re using the correct features. This guide covers all methods to check MySQL version on Windows.

Introduction

Knowing your MySQL version helps with:

  • Feature compatibility
  • Bug fixes and security updates
  • Documentation reference
  • Troubleshooting issues
  • Upgrade planning

Version Format: MySQL versions follow major.minor.patch format (e.g., 8.0.33)

Command Line Methods

Method 1: mysql —version

Simplest method:

mysql --version

Output example: mysql Ver 8.0.33 for Win64 on x86_64 (MySQL Community Server - GPL)

Method 2: mysqld —version

Server version:

mysqld --version

Output example: mysqld Ver 8.0.33 for Win64 on x86_64 (MySQL Community Server - GPL)

Method 3: mysqladmin version

Admin tool version:

mysqladmin version

Shows detailed version information including server status.

Advertisement

MySQL Client

Connect and Check

1. Connect to MySQL:

mysql -u root -p

2. Run version command:

SELECT VERSION();

Output: 8.0.33

Detailed Version Information

SHOW VARIABLES LIKE 'version%';

Output:

+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| version                 | 8.0.33                       |
| version_comment         | MySQL Community Server - GPL |
| version_compile_machine | x86_64                       |
| version_compile_os      | Win64                        |
+-------------------------+------------------------------+

Version Components

SELECT 
    VERSION() AS version,
    @@version_comment AS comment,
    @@version_compile_machine AS machine,
    @@version_compile_os AS os;

GUI Methods

MySQL Workbench

  1. Open MySQL Workbench
  2. Connect to server
  3. View version in Server Status tab
  4. Or run: SELECT VERSION();

phpMyAdmin

  1. Open phpMyAdmin
  2. Version displayed in Home page
  3. Or check Variables tab → search “version”

XAMPP Control Panel

  1. Open XAMPP Control Panel
  2. MySQL version shown next to MySQL service
  3. Or check MySQL service details

Windows Services

  1. Open services.msc
  2. Find MySQL service
  3. Right-click → PropertiesDetails tab
  4. Check File version

Programmatic Methods

PHP

<?php
$conn = new mysqli('localhost', 'username', 'password');

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$result = $conn->query("SELECT VERSION()");
$row = $result->fetch_array();
echo "MySQL Version: " . $row[0];

$conn->close();
?>

Python

import mysql.connector

conn = mysql.connector.connect(
    host='localhost',
    user='username',
    password='password'
)

cursor = conn.cursor()
cursor.execute("SELECT VERSION()")
version = cursor.fetchone()
print(f"MySQL Version: {version[0]}")

conn.close()

Node.js

const mysql = require('mysql2');

const connection = mysql.createConnection({
  host: 'localhost',
  user: 'username',
  password: 'password'
});

connection.query('SELECT VERSION()', (error, results) => {
  if (error) throw error;
  console.log('MySQL Version:', results[0]['VERSION()']);
  connection.end();
});

Understanding Version Numbers

Version Format

Example: 8.0.33

  • 8: Major version
  • 0: Minor version
  • 33: Patch/release number

Version Types

Community Server: Free, open-source version Enterprise: Commercial version with support Cluster: High-availability version

Check Version Type

SELECT @@version_comment;

Output examples:

  • MySQL Community Server - GPL
  • MySQL Enterprise Server
  • MySQL Cluster
Advertisement

Troubleshooting

Issue: mysql command not found

Solution: Add MySQL to PATH (see MySQL PATH guide)

Issue: Cannot connect to check version

Solutions:

  1. Start MySQL service
  2. Check credentials
  3. Verify MySQL is running

Issue: Version command shows different version

Possible causes:

  • Multiple MySQL installations
  • PATH pointing to wrong installation
  • Client/server version mismatch

Solution: Check which MySQL is in PATH:

where mysql

Quick Reference

Command Line: mysql --version MySQL Client: SELECT VERSION(); Detailed Info: SHOW VARIABLES LIKE 'version%'; GUI: Check in Workbench or phpMyAdmin

Conclusion

Multiple methods to check MySQL version:

  1. Command line - mysql --version (quickest)
  2. MySQL client - SELECT VERSION(); (most detailed)
  3. GUI tools - Workbench, phpMyAdmin
  4. Programmatic - Via connection in your language

Key Points:

  • Use mysql --version for quick check
  • Use SELECT VERSION(); for detailed info
  • Check both client and server versions
  • Understand version format for compatibility

Knowing your MySQL version is essential for development and troubleshooting.

Advertisement
Mahesh Waghmare

Written by Mahesh Waghmare

I bridge the gap between WordPress architecture and modern React frontends. Currently building tools for the AI era.

Follow on Twitter

Read Next