Content
There are several ways to check the version of the MySQL service on your account.
The first one includes accessing your account over SSH. When you log in, you can use the following command:
1
|
mysql –uUSERNAME –p‘PASSWORD’
|
where USERNAME is your cPanel username and PASSWORD is your cPanel password. Using the command you will connect to the MySQL service and see its welcome message, which includes the version of the service, for example:
1
2
3
|
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1993277
Server version: 5.6.28–76.1–log Percona Server (GPL), Release 76.1, Revision 5759e76
|
Another way of finding the MySQL version is via a PHP script. You have to create a new file on your account, for example mysql.php, and inside it place the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<?php
$mysql = mysqli_connect(‘localhost’, ‘USERNAME’, ‘PASSWORD’);
/* Test the MySQL connection */
if (mysqli_connect_errno()) {
printf(“Connection failed: %s\n”, mysqli_connect_error());
exit();
}
/* Print the MySQL server version */
printf(“MySQL server version: %s\n”, mysqli_get_server_info($mysql));
/* Close the MySQL connection */
mysqli_close($mysql);
?>
|
Again replace USERNAME with your cPanel username and PASSWORD with your cPanel password. Then open the file in your browser and you will see the MySQL version running on the current server.
You can create the file via SSH, FTP or from your cPanel -> File Manager tool.