How to import or export a database via SSH? Print

  • 0

It is often more convenient to import and export databases not through the phpMyAdmin interface, but using terminal commands by connecting to the server via SSH. This is especially useful when you need to load or unload a large database. DB import: mysql -u db_user -p db_name <db_dump_file Export (backup): mysqldump -u dbuser -p dbname > filename In the first case, the contents of the file you specified will be loaded into the database (in SQL format), in the second case, on the contrary, the contents of the specified database will be copied to the file.


Was this answer helpful?

« Back