Skip to content

Rate this page
Thanks for your feedback
Thank you! The feedback has been submitted.

For help, click the link below to get free database assistance or contact our experts for personalized support.

Clean up your installation

If you want to remove Percona Server for MySQL and clean up your system, follow the steps below for your installation method.

Warning

These steps will remove Percona Server for MySQL and may delete all data files (databases, tables, logs, etc.). Take a backup before proceeding if you need to preserve any data.

If you installed Percona Server for MySQL using Docker, follow these steps:

  1. Exit the MySQL command client shell if you’re still connected:

    exit
    

    You can also use \q or quit commands. The execution of the statement also closes the connection.

  2. Stop and remove the Docker container:

    docker container rm psmysql -f
    
    Expected output
    psmysql
    
  3. Remove the Docker image:

    docker image rmi percona/percona-server:8.4.7
    

    If you are running the ARM64 version of Percona Server, use:

    docker image rmi percona/percona-server:8.4.7-aarch64
    
    Expected output
    Untagged: percona/percona-server:8.4.7
    Untagged: percona/percona-server@sha256:4944f9b365e0dc88f41b3b704ff2a02d1459fd07763d7d1a444b263db8498e1f
    Deleted: sha256:b2588da614b1f382468fc9f44600863e324067a9cae57c204a30a2105d61d9d9
    ...
    
  4. Remove the Docker volume (if you created one):

    docker volume rm myvol
    
    Expected output
    myvol
    

If you installed Percona Server for MySQL using YUM or DNF on Oracle Linux or RHEL, follow these steps:

  1. Stop the Percona Server for MySQL service:

    sudo systemctl stop mysql
    
  2. Remove the packages:

    sudo yum remove percona-server*
    

    Or if you’re using DNF:

    sudo dnf remove percona-server*
    

    These commands remove the packages but leave data files behind. If you want to remove data files as well, continue to step 3.

  3. [Optional] Remove data and configuration files:

    Warning

    This step permanently deletes all data files (databases, tables, logs, etc.). Ensure you have a backup if you need this data.

    sudo rm -rf /var/lib/mysql
    sudo rm -f /etc/my.cnf
    

If you installed Percona Server for MySQL using APT on Ubuntu or Debian, follow these steps:

  1. Stop the Percona Server for MySQL service:

    sudo systemctl stop mysql
    
  2. Choose one of the following options:

    Option A: Remove packages but keep data files

    This command removes the packages but leaves data files (databases, tables, logs, configuration, etc.) behind:

    sudo apt remove percona-server*
    

    Option B: Remove packages and delete all data files

    Warning

    This command removes all packages and permanently deletes all data files (databases, tables, logs, etc.). Ensure you have a backup if you need this data.

    sudo apt purge percona-server*
    
  3. [Optional] If you used Option A and want to remove data files manually:

    Warning

    This step permanently deletes all data files. Ensure you have a backup if you need this data.

    sudo rm -rf /var/lib/mysql
    sudo rm -f /etc/mysql/my.cnf
    

Next steps

Next steps

Additional references