Installing Percona Server for MySQL server and Removing MySQL

Here, we will first install Percona Server for MySQL server and then see how to remove MySQL server


We will begin with a new VM (to check how to install VM you can check on my previous post)


Before starting your terminal should look like this:









If not then you check the previous post, for creating and running a VM

Now let's begin with the installation steps


Step 1: Download Percona MySQL repo package            

    wget https://repo.percona.com/yum/percona-release-latest.noarch.rpm

Step 2: Installing Percona MySQL repo locally            

    sudo yum localinstall percona-release-latest.noarch.rpm

Step 3: Enable Repo for Percona MySQL 8            

    sudo percona-release setup -y ps80

Step 4: Install MySQL Percona Server           

    sudo yum install percona-server-server

Step 5: Enabling MySQL service to auto-start on reboot          

    sudo systemctl enable mysqld.service

Step 6: Start MySQL service           

    sudo systemctl start mysqld.service

Step 7: Check the status of the MySQL service      

    systemctl status mysqld


Something like this should appear on the terminal after running the last command







To confirm whether Percona server is there:      

    mysql --version



Great, you have now installed the Percona flavour of MySQL server ðŸŽ‰


Now let's see how to uninstall MySQL server


Step 1: First search for the repo packages            

    rpm -qa | grep -i release           



Step 2: Now remove the repo          

    sudo yum -y remove percona-release
            (A complete message should be displayed in the last line)

Step 3: Now search for installed packages related to percona         

    rpm -qa | grep -i percona




Step 4: Remove all the related packages            

    sudo yum -y remove percona-server-shared          
    sudo yum -y remove percona-server-shared-compat          
    sudo yum -y remove percona-icu-data-files

Step 5: Now verify whether all packages have been deleted or not            

    rpm -qa | grep -i percona

        If there are files left, you can remove them by using command :                                      

    sudo yum -y remove<package-name>

Step 6: Remove MySQL user          
    grep mysql /etc/passwd            
    sudo userdel            
    sudo userdel -r mysql










Step 7: Remove other leftover files            

    ls /var/lib           
    ls /var/log

Step 8: To verify the removal          

    pidof mysqld


If your terminal does not respond after running the above command, then you have successfully uninstalled MySQL server 🎉


        







Comments