CityHost.UA
Help and support

How to import/export a large database?

Virtual hosting servers have a limit on the maximum amount of files that can be downloaded using PhpMyAdmin .
Maximum file size = 300 MB.

To work with this type of files, it is more rational to use an SSH connection and import/export databases through it.

To connect via SSH to the hosting server, use the help section available at [link]

To import the database to the MySQL server, use the following command:

 mysql --host='127.0.0.1' --user='ПОЛЬЗОВАТЕЛЬ' --password='ПАРОЛЬ' 'НАЗВАНИЕ_БАЗЫ_ДАННЫХ' < НАЗВАНИЕ_ДАМП_ФАЙЛА.sql

To export a database from a MySQL server, use the following command:

 mysqldump --host='127.0.0.1' --user='ПОЛЬЗОВАТЕЛЬ' --password='ПАРОЛЬ' 'ИМЯ_БАЗЫ_ДАННЫХ' > ИМЯ_ДАМП_ФАЙЛА.sql

To export a database from one database and instantly import it into another, use the following command:

 mysqldump --host='СЕРВЕР_1' --user='ПОЛЬЗОВАТЕЛЬ_1' --password='ПАРОЛЬ_1' 'ИМЯ_БАЗЫ_ДАННЫХ_1' | mysql --host='СЕРВЕР_2' --user='ПОЛЬЗОВАТЕЛЬ_2' --password='ПАРОЛЬ_2' 'ИМЯ_БАЗЫ_ДАННЫХ_2'

[SERVER] the server of your hosting. If you run locally using an SSH connection to your hosting, you can use localhost . You can see the value for the [host] parameter in the section: [Control panel -- Hosting2.0 -- Management -- MySQL -- Databases -- Server for remote connection];
[USER] is
the user you use to connect to the database. You can see the user attached to the database using [instruction] ;
[PASSWORD] —
the password of the user you use to connect to the database. You can see the database user's password using [instructions] ;
[НАЗВАНИЕ_БАЗЫ_DАННЫ] —
the name of the database you use for import/export;
[NAME_DUMP_FILE] — the absolute path
to the file that you use for EXPORT or the absolute path to the file that you want to record the result of IMPORT ;