Google

Import large Mysql SQL Files using ssh

Written on:July 11, 2011
Comments
Add One

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:
$ mysql -u username -p -h localhost data-base-name < data.sql

If you have dedicated database server, replace localhost name with actual server name or IP address:
$ mysql -u username -p -h 192.168.1.10 databasename < data.sql
OR use hostname such as mysql.hosting.com
$ mysql -u username -p -h mysql.hosting.com database-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:
$ mysql -u username -p -h 192.168.1.10 < data.sql

2 Comments add one

  1. Alexandra says:

    Way to go on this essay, hepeld a ton.

  2. Carley says:

    One or two to rmebemer, that is.

Leave a Comment

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>