I am running MariaDB 10.3 on Ubuntu 20.04. Now MariaDB is not running and one database in it. Can I uninstall the MariaDB 10.3 retaining database? My plan is that install a higher version of MariaDB and get back the existing database. If so, which commands do I have to apply?

  • 2
    Dump the database (mysqldump databaseName > file.sql) , reinstall MariaDB, and import the database (mysql databaseName < file.sql). Is that what you need?
    – Jos
    Feb 17 at 10:55

2 Answers 2

mysqldump -u [username] -p [DATABASE name] > [backup filename].sql

mysql -u [username] -p [DATABASE name] < [backup filename].sql
  • MariaDB service is not running because of mysqld.sock problem. MySQL dump command will not work. Feb 18 at 11:04

I got the solution, uninstall MariaDB without deleting databases and reinstall it again.

sudo apt purge "mariadb*" -y
sudo apt autoremove -y
sudo apt-get install mariadb-server mariadb-client

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.