Import a large MySQL file using SSH
by
, 04-28-2012 at 07:13 PM (2163 Views)
You can easily restore or import MySQL data with MySQL command itself. First you need to login to your system using ssh or putty (from Windows based system).
For example: Login to SSH (make sure you have access to SSH, contact your hosting provider)
Now type following command to import sql data file:
If you have dedicated database server, replace localhost name with actual server name or IP address:Code:$ mysql -u username -p -h localhost data-base-name < data.sql
If you do not know the database name or database name is included in sql dump you can try out something as follows:Code:$ mysql -u username -p -h 192.168.1.10 databasename < data.sql
Code:$ mysql -u username -p -h 192.168.1.10 < data.sql