Large databases are hard to import through phpMyAdmin because of upload size and time limits. On a server without a control panel you also need the command line. Here is how to import a database over SSH.
1. Connect to your server over SSH (see how to connect to your server over SSH).
2. Upload your .sql file to the server, for example with SFTP.
3. Create an empty database and a user, and give the user privileges on it. Log in as root and enter the MySQL root password:
mysql -u root -p
CREATE DATABASE hyyat; CREATE USER 'hyyat'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON hyyat.* TO 'hyyat'@'localhost'; FLUSH PRIVILEGES; exit
Here the database and user are both named hyyat. Use your own names and a strong password.
4. Go to the folder with your .sql file and import it:
mysql -u hyyat -p hyyat < hyyat123.sql
Enter the user’s password when asked, and wait until the command finishes. The -p option without a value asks for the password, so it does not appear in your shell history.
See also basic MySQL commands over SSH and how to import and export a database with phpMyAdmin.
Related service: Hyyat Host server management can migrate and import large databases for you, with 24/7 support.