Introduction
Checking the MySQL version is crucial to ensure you have access to the latest bug fixes, security patches, and performance improvements. This practice maintains compatibility, enhances security, and optimizes the database system performance.
The following text will show you how to check the MySQL version on Windows.
Requirements
- A Windows system (this tutorial uses Windows 11).
- MySQL installed.
- Access to the command prompt.
Check MySQL Version by Finding the MySQL Installation Path
On Linux, it's easy to find the MySQL version by running the mysqld --version
. However, checking the MySQL version on Windows is a bit different.
For instance, run:
mysqld --version
The command produces an error message. Mysqld is always in the executable path in Linux. On Windows, however, it is in the MySQL installation directory, which is not always included in the PATH environment variable. This makes checking the MySQL version in Windows a bit more complex.
You need to locate the MySQL installation path to check the MySQL version on Windows. Follow these steps:
1. Navigate to the C:\Program Files\MySQL folder.
2. Open the MySQL Server folder.
3. Access the bin folder.
3. Copy the whole path, including the bin folder. In this case, the path is C:\Program Files\MySQL\MySQL Server 8.0\bin.
4. Next, open the command prompt and run cd
with the copied path:
cd C:\Program Files\MySQL\MySQL Server 8.0\bin
6. Execute the mysqld --version
command:
mysqld --version
The output shows the current MySQL version.
Check MySQL Version in Windows via the Command Line Client
An easier way to check the MySQL version is via the Command Line Client. The Command Line Client comes with the MySQL installation. Take the following steps to check the MySQL version via the Command Line client:
1. Open MySQL Command Line Client.
2. Enter the root password.
2. Next, check the MySQL version with:
SELECT VERSION ();
The output shows the version is 8.0.35.
Check MySQL Version in Windows via CLI
An alternative way to check the MySQL version is via Windows CLI. To do that, follow these steps:
1. Access the command prompt.
2. Use cd to navigate to the MySQL installation directory's bin folder. In our case, it is C:\Program Files\MySQL\MySQL Server 8.0\bin, but it depends on the system:
cd C:\Program Files\MySQL\MySQL Server 8.0\bin
3. Connect to the MySQL server as the root user with a password prompt:
mysql -u root -p
4. Enter the root password
5. Execute this command to the version:
SHOW VARIABLES LIKE 'version';
Check MySQL Version Via MySQL Workbench
MySQL Workbench lets you obtain comprehensive information about the installed MySQL server, including the version number. To find the MySQL version number via MySQL Workbench, follow these steps:
1. Launch MySQL Workbench.
2. Establish a connection to the MySQL server.
3. Navigate to Server Status under Management in the left-side panel.
4. The primary work area contains details such as the installed MySQL server version and other relevant information.
Check MySQL Version Via the mysqladmin Tool
The mysqladmin
tool is a command-line utility tool for server administration tasks. It allows users to perform various administrative operations, including checking the MySQL version.
To check the MySQL version, follow these steps:
1. Open Command Prompt.
2. Navigate to the MySQL server bin directory. In our case:
cd C:\Program Files\MySQL\MySQL Server 8.0\bin
3. Type in the following syntax using your password:
mysqladmin version –user=root –password=[password]
Replace [password] with your password without using the parenthesis:
The output shows the server status and version.
Conclusion
After reading this article, you now know how to use five different ways to check the MySQL version in Windows.
Next, learn how to create a table in MySQL.