How to Check MySQL Version via The Command Line

Most web applications run thanks to MySQL databases. Aside from being free (a paid proprietary enterprise solution exists but is not required for most projects), the software is impressively reliable. It’s also easy to use and super secure.

MySQL can handle millions of queries and supports high-speed transactional processing for eCommerce websites.

The first version of MySQL appeared in 1995, and today, over ten other versions exist.

Knowing your MySQL version will help you figure out whether you need to make any configuration changes and tweak settings to keep your applications running perfectly.

This article will help you find the MySQL version via the command line.

Method 1: SSH Shell

The secured socket shell is a network protocol that allows two computers to communicate and reliably share data. 

Webmasters and Database Administrators often use SSH to log into a remote computer and perform tasks on the server from anywhere. It’s basically the same as hooking up a monitor and a keyboard to the server.

SSH connections are end-to-end encrypted, so you don’t need to worry about anyone eavesdropping the communication between your computer and the remote host.

There are a couple of ways of establishing an SSH connection to your server: you can either use a client application like PuTTY, or you can do it via your operating system’s built-in command line shell. Windows users can employ PowerShell or the command prompt and Linux and MacOS have the Terminal.

To check the version your MySQL is running, type and execute mysql -V (note the uppercase V) in the command line.

MySQL will return a result that looks like this:

How to Check MySQL Version via The Command Line, Method 1: SSH Shell

As you can see, the MySQL version for this system is 10.4.12.

Method 2: MySQL Shell

The MySQL Shell is an advanced client and code editor for MySQL. It provides scripting capabilities for JavaScript and Python and includes APIs for working with MySQL.

Webmasters use MySQL shell to perform data queries and updates, as well as various administrative operations.

To check the MySQL version from the MySQL Shell, you simply need to log into it. The command you need looks like this:

$ mysql -u [your MySQL username] -p

MySQL will ask you for the user’s password and after you enter it, it will display the version automatically.

How to Check MySQL Version via The Command Line, Method 2: MySQL Shell

Once you’re logged in, you can also find the MySQL version using the following command:

show variables like ‘%version%’;

MySQL will return the version result after executing the command:

How to Check MySQL Version via The Command Line, Method 2: MySQL Shell 2

Understanding The MySQL Naming Scheme

Always make sure to run the latest MySQL version on your server.

Install only the latest MySQL General Availability (GA) release. The GA releases are MySQL stable versions and are safe and reliably for production uses. Although developmental releases have the newest features, they are not suitable for production uses.

MySQL 8.0.28 is the latest MySQL version. 

The naming scheme uses release names that consist of three numbers and an optional suffix, for example, mysql-8.0.1-dmr.

Understanding the naming scheme will enable you to know the correct version to install. Here’s how to interpret a MySQL version number.

  • The first number shows the major version number. In the above case, it’s eight.
  • The second number shows the minor version number. In the example above, it’s zero. The major and minor version numbers constitute the release series number, and it describes the stable feature.
  • The third number shows the number for each bug-fix release. The version with the latest bug-fix makes the best choice, of course, in most cases.
  • The suffix indicates the stability level of each release. Two possible suffixes are dmr and rc. The former stands for Development Milestone Releases, while the latter stands for Release Candidate.

New features with dmr releases are not thoroughly certified for production uses. 

Release Candidate is the second development stage in the series.

Although the vendors believe the RC series is relatively stable, their efforts shift to fixing bugs to stabilize the features. They might also introduce new features at this stage.

MySQL versions without any suffix are pretty stable, free of bugs and suitable for production uses. They have attained the GA status.

Wrapping It Up

Running the latest stable version of MySQL enables you to enjoy the newest features and have software free of bugs. You can always check your MySQL by following the steps we outlined above. You can always contact Support whenever you need help.

Was this helpful?

What’s your goal today?

1. Find the right Web hosting solution

If you’re looking for industry-leading speed, ease of use and reliability Try ScalaHosting with an unconditional money-back guarantee.

2. Make your website lighting fast

We guarantee to make your WordPress site load in less than 2 seconds on a managed VPS with ScalaHosting or give your money back. Fill out the form, and we’ll be in touch.

Please enter a valid name
Please enter a valid website
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

3. Streamline your clients’ hosting experience

If you’re a web studio or development agency hosting more than 30 websites, schedule a call with Vlad, our co-founder and CTO, and see how we can deliver unmatched value to both your business and your clients.

Photo

Need a custom cluster or professional advice?

Book a meeting and get a free 30-minute consultation with Vlad, co-founder & CTO of Scala Hosting, who will help you select, design and build the right solution - from a single data center cluster to a multi-region & multi-datacenter high availability cluster with hundreds of servers.

Book a free consultation

4. Learn how to grow your website in 2024

An all-star team of SEO and web influencers are sharing their secret knowledge for the first time in years. Learn about the future of SEO, Web Design best practices and the secrets to getting the foundation for your website to thrive. Watch the exclusive webinar.

An Exclusive Insiders Look Behind The SEO and Web Development Curtain

Rado
Author

Working in the web hosting industry for over 13 years, Rado has inevitably got some insight into the industry. A digital marketer by education, Rado is always putting himself in the client's shoes, trying to see what's best for THEM first. A man of the fine detail, you can often find him spending 10+ minutes wondering over a missing comma or slightly skewed design.