Import/Export DB via SSH

A short note found on the Internet on the import / export of the database via SSH

DB import

mysql -u dbuser -p dbname < dbdumpfile

DB export (backup)

mysqldump -u dbuser -p dbname > filename

upd. In case the host starts to swear

mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces

We run the same command but with the argument --no-tablespaces

mysqldump --no-tablespaces -u dbuser -p dbname > filename

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
The comment language code.