How to Export and Import a MySQL Database Using Command Line
Having an up-to-date backup of your database is essential to protect your critical information and ensure business continuity. In this tutorial, we will show you how to export a database using the command line.
It is important to perform a complete backup of the database before any procedure
Exporting the MySQL database
Open a terminal or command line on your operating system and run the following command to export the database:
- mysqldump -u [usuario] -p [base_de_datos] > [ruta_del_archivo.sql]
The command will run and export the database in SQL format to the specified file.
Importing the MySQL database
Run the following command to import the database:
- mysql -u [usuario] -p [base_de_datos] < [ruta_del_archivo.sql]
Remember that this tutorial is a general example and the commands may vary depending on the database management system you are using. Make sure to adjust the commands and parameters according to your specific needs and configuration.
Related Articles
Using Screen on Linux: create, resume, and close terminal sessions
Screen is a command-line tool on Linux that allows you to manage multiple, persistent terminal sessions. With screen, you can run programs in the background, detach from a session without closing it, and resume it later. This is useful for ...
JetBackup 5: How to fix the Integrity Check error using CLI/SSH
When JetBackup performs its automated integrity verification processes, they may sometimes complete partially due to network interruptions, timeouts, or communication issues with the remote storage destination. If you receive notifications indicating ...
How to delete iDrive e2 files using AWS CLI on Mac
When you need to delete large amounts of files from an iDrive e2 bucket, doing it through the web interface can take hours or even days. The most efficient solution is to use AWS CLI from your Mac terminal, as it processes multiple files in parallel ...
Basic SSH commands
FILE MANAGEMENT Copy file cp -a archivo.zip archivocopia.zip Create a 404.html file touch /home/usuario/public_html/404.html Compress directory zip -r archivo.zip /home/usuario/public_html/directorio Extract file unzip archivo.zip View contents of a ...
How to Block IPs and Ranges in Imunify360: CLI & GUI Master Guide
Imunify360 is the ultimate defense for web servers. While its automated firewall is excellent, manual intervention is sometimes necessary to stop botnets or targeted attacks. In this guide, you will learn how to manage blocks precisely using commands ...