Completely removes MariaDB packages, data directories, and configuration files so you can free resources or switch fully to PostgreSQL.
Uninstalling MariaDB removes the server, client tools, libraries, log files, and data directories from your machine. It also frees port 3306 so PostgreSQL or other services can use it.
Backups let you migrate existing data—such as an Orders
table—to PostgreSQL later. Dump everything with mysqldump --all-databases > mariadb_backup.sql
before removal.
Stop the service, purge packages, and delete data:
sudo systemctl stop mariadb
sudo apt-get purge --auto-remove mariadb-server mariadb-client
sudo rm -rf /var/lib/mysql /etc/mysql
Use dnf
(or yum
):
sudo systemctl stop mariadb
sudo dnf remove mariadb-server mariadb
sudo rm -rf /var/lib/mysql /etc/my.cnf.d
Run:
brew services stop mariadb
brew uninstall mariadb
rm -rf /usr/local/var/mysql /usr/local/etc/my.cnf
Use "Apps & Features" to remove MariaDB <version>, then delete C:\Program Files\MariaDB
and C:\ProgramData\MySQL
.
Search for my.cnf
, my.ini
, and .my.cnf
in your home directory and remove them to avoid client-side conflicts.
After uninstalling, verify with sudo lsof -i :3306
. If nothing appears, the port is free for PostgreSQL.
Orders
data to PostgreSQL# 1. Dump MariaDB data (done before uninstall)
mysqldump ecommerce Orders > Orders.sql
# 2. Convert SQL if needed, then restore into PostgreSQL
psql -d ecommerce -f Orders.sql
Update documentation, disable any automation that expected MariaDB, and monitor your PostgreSQL logs to confirm no residual MySQL clients are still connecting.
Not purging config – simply removing packages leaves my.cnf
. Always delete config directories.
Forgetting backups – once deleted, data directories are unrecoverable. Always dump databases first.
Not if you back up first. Use mysqldump --all-databases
, verify the SQL file, then proceed.
Yes. Simply install via your package manager again. Remember to restore your backup into the fresh instance.
No. They are separate services. Removal only frees resources previously held by MariaDB.