How to export all MySQL databases

Mar 18, 2022 · 1 min read · Post a comment

Keeping the database structure in one place and safe can sometimes be useful regarding disaster recovery. Exporting all MySQL databases into one SQL file it’s not a common thing, but it can be a lifesaver.


  • MySQL
  • MariaDB
  • root access

Export All MySQL Databases into one SQL file

To export all the MySQL databases you need to have access to the root user or another user who has admin rights to all databases.

mysqldump -u root -p --all-databases > alldb.sql


Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.