How to Install Only MySQL Client on CentOS, Redhat, Fedora and Ubuntu
Question:- I have MySQL database server running on CentOS and I would like to install only MySQL Client without installing MySQL server on the server. Do you have any idea how I can install only MySQL Client on CentOS and Linux based system.
Answer :- Yes, It is very easy to install only MySQL client Program and shared libraries on your Linux based system and no need to install the MySQL database server. Follow the below command to install the MySQL Client on Linux based system.
MySQL :- This package is a server/client implementation consisting of a MySQL client and many different client programs and libraries.
Install MySQL Client on CentOS, Redhat, and Fedora
You will need to root access privilege to install the below package. Now Open the terminal and login to the Linux system using SSH. Now follow the below command.
# yum install mysql Loaded plugins: downloadonly, fastestmirror, security Loading mirror speeds from cached hostfile * base: mirror.wiredtree.com * extras: mirrors.serveraxis.net * updates: bay.uchicago.edu Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package mysql.x86_64 0:5.1.71-1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: mysql x86_64 5.1.71-1.el6 base 893 k Transaction Summary ================================================================================ Install 1 Package(s) Total download size: 893 k Installed size: 2.4 M Is this ok [y/N]: y Downloading Packages: mysql-5.1.71-1.el6.x86_64.rpm | 893 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : mysql-5.1.71-1.el6.x86_64 1/1 Verifying : mysql-5.1.71-1.el6.x86_64 1/1 Installed: mysql.x86_64 0:5.1.71-1.el6 Complete!
Install MySQL Client on Ubuntu and Debian
To install MySQL Client on Ubuntu and Debian based system you will need to use apt-get command. Follow the below command to install MySQL Client on Ubuntu.
$ sudo apt-get install mysql-client OR Alternatively $ sudo apt-get install mysql*
MySQL Client Usage
Follow the basic syntax to access your database server using MySQL Client.
mysql -u USER-NAME -h MYSQL-DATABASE-SERVER-IP-ADDRESS -p DB-PASSWORD
#mysql -u look_user -h app1.looklinux.com -p look_password Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 170603 Server version: 5.6.27 MySQL Community Server (GPL) Copyright (c) 2000, 2016, 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>
I hope this article will help to install only MySQL Client on your Linux system. If you have any queries and problem please comment in comment section.