image_pdfimage_print

MySQL has gone through several versions over the years, and every version introduces changes to syntax and the way data is stored on your server. Developers need to know the MySQL version so that they can use specific features available with newer versions. Older features might be deprecated and no longer available in newer versions. These issues can create problems in newer applications or after database administrators upgrade to newer versions of MySQL.

Before you can query for the MySQL version, you need access to the command-line terminal and the right permissions to the remote server. You can query the MySQL version in several ways, but the general syntax depends on the operating system.

How to Check Your MySQL Version: Ubuntu

Ubuntu is a Linux distribution popular with developers. It’s one of the more popular Linux distributions for users who are unfamiliar with Linux and want to learn the operating system.

To start the command-line utility, type the following into your terminal:

The above command gets the server version. If you need to know the client application version, use the following command:

Output for the command would look similar to the following:

How to Check Your MySQL Version: Mac Terminal

Although you probably run MySQL on a Linux distribution or the Windows operating system, you might have a Mac to connect to the server. You can get the version for the MySQL engine by using the Mac terminal in the same way you would use a Linux terminal.

The following command gets the server version in your Mac terminal:

mysqld –version

The above command shows you the server’s version. If you want to see the client version, use the following command:

mysql –version

How to Check Your MySQL Version: Windows

MySQL server runs on the Windows operating system, although it’s more commonly used on Linux distributions. You can install MySQL server on a Windows server and use the client application on a Windows desktop.

The command to check the MySQL server version is the same in Windows as in Linux. The following command sends output to the console listing the server version:

mysqld –version

The client version is shown when you open the MySQL terminal. If you use the shortcut on the Windows menu, the terminal opens and the client version is displayed. The following command will also show you the client version:

mysql -v

Conclusion

Regardless of your client operating system, knowing how to identify the MySQL version running on the database server is a critical part of development. Every major upgrade to a new version of MySQL adds new features, and developers deprecate some functionality. By querying for the database version, you can take advantage of newer features that make applications faster and help developers write more efficient code.