Friday , December 6 2024

Concurrent MySQL client

CCQL:

CCQL is a tool that allow user to connect multiple mysql server node Concurrently at the same time. It comes into picture when a user want to run a same operation on multiple server and it operational time.

How It works?

It connects to multiple MySQL servers at the same time with the given options & credentials or in other way user and password should be same to runs given query. This saves operational time and gives better productivity.

Download ccql binary from the following weblink:
https://github.com/github/ccql/releases

Below is the Quick option which can be used while doing using CCQL

Usage of ccql:
  -C string
        Credentials file, expecting [client] scope, with ‘user’, ‘password’ fields. Overrides -u and -p
  -H string
    Hosts file, hostname[:port] comma or space or newline delimited format. If not given, hosts read from stdin
  -Q string
    Query/queries input file
  -d string
      Default schema to use (default “information_schema”)
  -h string
    Comma or space delimited list of hosts in hostname[:port] format. If not given, hosts read from stdin
  -m uint
    Max concurrent connections (default 32)
  -p string
    MySQL password
  -q string
    Query/queries to execute
  -s string
      List of databases to query from; overrides -d, prints schema name to output
  -t float
    Connect timeout seconds
  -u string
    MySQL username (default OS user)
Lets see few example how it can be used.
  1. If a DBA want to check the version of all the servers whether they are exactly same or not.

the above command

-C : we need to pass the credential file which contains login id password of the user which is common among all node

 

-h : You can either pass the hostname or pass the hostname file which It contains the list of host name that you want to connect.

-q : the Query which you are going to pass to the servers.

2. Even one can use Bash/shell script predefined function with that command to filter the output

 

e.g

 

The given above are the basic example for the understanding there are lot of things a DBA can do using this tool and save operational time.

More details are available on the given below Link.

https://github.com/github/ccql

Loading

About Bharat Sahu

One comment

  1. Nice one Sahu, Good going.

Leave a Reply

Your email address will not be published. Required fields are marked *