Linux Shell Script : Check If MySQL Packages Installed

Discussion in 'Shell / Command Line' started by nixsavy, Sep 17, 2013.

  1. nixsavy

    nixsavy Member

    Messages:
    65
    Likes Received:
    17
    Trophy Points:
    8
    This shell script can check if you have installed mysql and mysql-server packages in your Linux system.
    Comments are provided over each line to understand the script better. Refer shell scripts programs to learn more.


    Linux shell script


    Shell script output:

    Case 1 output cause:You have installed mysql and mysql-server packages.

    #./mymysql.sh

    You have installed mysql

    You have installed mysql-server


    Case 2 output cause:You have installed mysql,and not installed mysql-server.

    #./mymysql.sh

    You have installed mysql

    MySQL-SERVER is not in your system.


    Case 3 output cause:You haven't installed mysql,and installed mysql-server.

    #./mymysql.sh

    MySQL is not in your system.

    You have installed mysql-server


    Case 4 output cause:You haven't installed mysql and mysql-server.

    #./mymysql.sh


    MySQL is not in your system.

    MySQL-SERVER is not in your system.

    Attached Files:

    DevynCJohnson likes this.

Share This Page