Steps to export a MySQL database from the command line
-
To use this tool, you will need to access your Cloud Server via SSH:
Additional Information
You can find more information about accessing your server via SSH in the article:
-
Once you are logged in to the server, you will need to run the following command:
# mysqldump -u usuario -p base_de_datos > archivo.sqlHere, "usuario" should be replaced with the MySQL user, and in “base_de_datos” you must specify the database you want to back up. Finally, you will need to replace “archivo.sql” with the name to use for the database backup. Once you run the command, you will be prompted to enter the password. It is important to note that this command will create the database backup in your current directory.
-
Additional Information
You can also use the following command to export all databases:
# mysqldump -u root -p --all-databases > alldb.sqlIf you need more information on importing or restoring a database, you can consult our article: