Fun at work!

Posts tagged ‘command line’

How to check MySQL version?

On the command line, enter the command:


# mysqladmin -uroot -p -hlocalhost version

Enter password: ********

mysqladmin  Ver 8.42 Distrib 5.1.73, for redhat-linux-gnu on x86_64
Copyright (c) 2000, 2013, 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

Server version          5.1.73
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 16 hours 18 min 39 sec

Threads: 1  Questions: 296  Slow queries: 0  Opens: 25  Flush tables: 1  Open tables: 18  Queries per second avg: 0.5


There you can get the version of MySQL.

How to add a user to sudoers file?

You need root access to add a user to the sudoers file. Enter as root user:

# su -

and put in the root password. Then use this command

# visudo

to make changes on the /etc/sudoers file. It is not recommended to edit the file using text editor.

To add a user, enter the line in appropriate location.

username    ALL=(ALL) ALL


%groupname  ALL=(ALL) ALL

Command line error: “ssh: command not found”

I just installed CentOS 6.4 and enabled SSH, HTTP and HTTPS on the firewall configuration required for my server application. When I used ssh to connect to another machine, I got this command line error “ssh: command not found”. I got this error because I enabled SSH service as ssh server daemon only, and I don’t have ssh client running.

To install sshd server and client:

yum -y install openssh-server openssh-clients

Check out:

How to check CentOS version?

Using cat command (concatenate files) and print on the standard output

# cat /etc/*release*
CentOS release 6.4 (Final)


# cat /etc/redhat-release
CentOS release 6.4 (Final)

Tag Cloud