2.11.5. Export database using console

The size of the database dump can be significantly smaller than the size of the database on the hosting.

To export a database or tables, do the following:

  1. Connect to the hosting via SSH.
  2. Export data:
    mysqldump -h DB_HOST -u DB_LOGIN -p DB_NAME > PATH/TO/DUMP.SQL

    In the command, use your own data:

    • DB_HOST, DB_LOGIN, DB_NAMEdata for connecting to the database, from where the export is performed.
    • PATH/TO/DUMP.SQL — path to the SQL file where the dump should be saved (or its name if the file is in the current directory).
    mysqldump -h DB_HOST -u DB_LOGIN -p DB_NAME TABLE1 TABLE2 TABLE3 > PATH/TO/DUMP.SQL

    In the command, use your own data:

    • DB_HOST, DB_LOGIN, DB_NAMEdata for connecting to the database, from where the export is performed.
    • TABLE1, TABLE2, TABLE3 — names of tables to be exported.
    • PATH/TO/DUMP.SQL — path to the SQL file where the dump should be saved (or its name if the file is in the current directory).
  3. Enter database user password (for security reasons, characters are not displayed on the screen when entering the password).
  4. Wait for the command to complete.
目录

    评论

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

    при цьому в MySQL для користувача всі Database Access Privileges активовані
    karlov
    Спробуйте додати в команду опцію --no-tablespaces. Це повинно вирішити проблему.
    DAAD
    Так, спрацювало, дякую