Advanced users may wish to use SSH to access and make changes to their account, offering a more robust set of options with fewer limitations. These instructions will require a basic familiarity with SSH. If you are interested in learning to use SSH, please check the article below for information on how to get started:
To import your database after you have logged in to your account with SSH:
Note: Your database file must be in .sql format, it cannot be compressed in a .zip or .tar.gz.
- Upload your database to your home directory (This may be done with cPanel File Manager, an FTP client, or SSH).
- If the database does not exist, please create a database, a user, and give the user full privileges to the database. Note the username and password.
For assistance with creating a Database and Database user, please see the article below:
- Log into your server via SSH.
- Use the ls -l command to verify that the file is in your current directory.
- If the file is not present, upload/move the file to the correct directory, or navigate to the directory where the file is located.
- Enter the following command, replacing ‘user_name’, ‘database_name, and ‘file.sql’ with the correct values for your database and file:
mysql -p -u user_name database_name < file.sql
- You will be prompted for your database user password, and then your database will be imported.
Notes:
- HostGator recommends using the database user with the database user’s password.
- Make sure your database name and username has your HostGator username prefix (e.g. ‘username_databasename’; ‘username_databaseusername’).