How to check MySQL version through shell (SSH) on a Linux Server?

Gmeister4

Well-known member
Registered
Joined
Apr 19, 2016
Messages
178
Points
18
My web developer is asking which MySQL version I am using on my vps server and I checked with this command
[root@server ~]# mysql -V
mysql Ver 15.1 Distrib 10.1.22-MariaDB, for Linux (x86_64) using readline 5.1
but he said it is not for my version of server, I tried to run this command but it is error

[root@server ~]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Any suggestions?
 

Nixtree

Well-known member
Registered
Joined
Jul 16, 2016
Messages
133
Points
28
Mysql version is 10.1.22-MariaDB in your case and the second command you need to use

# mysql -u root -p
and then you will be getting a password prompt and give that.

If you are using plesk, then you need to use admin user and admin password
 

Gmeister4

Well-known member
Registered
Joined
Apr 19, 2016
Messages
178
Points
18
Gmeister4
I need to login to mysql server by using this command mysql -u root -p ?
And next I will use this command to check mysql version of server?
mysql
or
SHOW VARIABLES LIKE "%version%";
?
I am confusing what is the difference between version of mysql client and mysql server?
 

Nixtree

Well-known member
Registered
Joined
Jul 16, 2016
Messages
133
Points
28
I am pasting all possible options (real time values in one of my test server) and my test cpanel server is having 5.5 mysql version

root@ [~]# mysql --version
mysql Ver 14.14 Distrib 5.5.58, for Linux (x86_64) using readline 5.1

root@[~]# mysql -V
mysql Ver 14.14 Distrib 5.5.58, for Linux (x86_64) using readline 5.1

root@[~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 845832
Server version: 5.5.58-cll MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+------------------------------+
| Variable_name | Value |
+-------------------------+------------------------------+
| innodb_version | 5.5.58 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.5.58-cll |
| version_comment | MySQL Community Server (GPL) |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
+-------------------------+------------------------------+
7 rows in set (0.00 sec)

mysql>

If rpm based installation you can see using the below rpm command as well

root@[~]# rpm -qa |grep MySQL55-
MySQL55-client-5.5.58-1.cp1162.x86_64
MySQL55-server-5.5.58-1.cp1162.x86_64
 

Nixtree

Well-known member
Registered
Joined
Jul 16, 2016
Messages
133
Points
28
Older Threads
Replies
4
Views
2,786
Replies
5
Views
1,853
Replies
1
Views
1,513
Replies
0
Views
1,363
Latest Threads
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top