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

Gmeister4

Well-known member
Joined
Apr 19, 2016
Messages
126
Best answers
0
Ratings
8
Points
18
#1
My web developer is asking which MySQL version I am using on my vps server and I checked with this command
[[email protected] ~]# 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

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

Nixtree

Well-known member
Joined
Jul 16, 2016
Messages
120
Best answers
0
Ratings
40 4
Points
28
#2
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
Joined
Apr 19, 2016
Messages
126
Best answers
0
Ratings
8
Points
18
#3
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
Joined
Jul 16, 2016
Messages
120
Best answers
0
Ratings
40 4
Points
28
#4
are you having cpanel or plesk or any control panel ? Do you have root password with you for the mysql ?
 

Nixtree

Well-known member
Joined
Jul 16, 2016
Messages
120
Best answers
0
Ratings
40 4
Points
28
#6
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

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

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

[email protected][~]# 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

[email protected][~]# 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
Joined
Jul 16, 2016
Messages
120
Best answers
0
Ratings
40 4
Points
28
#8
Older Threads
Replies
1
Views
128
Replies
30
Views
495
Latest Threads
Replies
0
Views
16
Replies
0
Views
1
Replies
2
Views
25
Replies
2
Views
41
Recommended Threads
Similar Threads

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

Top