Hi I need to import databases as size is more I'm unable to do so using phpmyadmin. How to Import a Database Over SSH?
Import Database
Collapse
Unconfigured Ad Widget
Collapse
X
-
SSH provides a superior way to manage the files and databases on your account. With a straightforward command, you can import a MySQL database into an existing database on your account.
Import database using SSH.
Upload the database to your home directory via FTP or with the File Manager.
Connect to your hosting account via SSH.
If a database backup file appears, proceed to the next step.
If the backup file doesn't appears, using the File Manager ensures that the file is indeed uploaded.
If the database does not exist, please create both the database and a user and grant the user complete privileges to the database. Note down the username and password.
If the database is in compressed format (.sql.gz), use the following command to extract it so it's in .sql format:
gzip -d database_name.gz.sql
Ensure to replace database_name with your database's actual name.
To import the database, use this command:
mysql -u database_username -p database_name < file.sql
You will be prompted to provide your database password & then your database will be imported.
The database that is being imported may take some time, depending on its size.
-
Comment