Using Putty To Import A Database

Do you have a database too big to import using phpMyAdmin? Well if you have root access, you can use Putty to import a database for you. If you’ve never used Putty before it could be daunting task the first time, I know it was for me. But after learning the basics and one of the most import features, its cake now!

Using putty ~

One trick that basically got me started was being able to copy and paste! It’s actually fairly easy, but not obvious. Simply copy the text your want to use from any location, and right click into putty to paste. Note: When pasting a password your password won’t show up after right-clicking. It’s there, but you can’t see it.

So to paste into Putty, simply right click your copied text in the window and that’s it.

Once you’re logged into your server using Putty. Ask your server admin if you’re having trouble doing this, its cake to import your database.

First you’ll need to make sure the database you want imported is uploaded to your website directory. Using any of your favorite FTP programs, upload the SQL file now. This would be your database backup file.

puttyOnce your SQL file is uploaded, your need to change your Putty directory to the location where you file is located.

To change your directory in Putty, use the cd command followed by the directory you want to change to. For me the command would be:

cd /var/www/vhosts/aspkin.com/httpdocs

This takes me to aspkin.com httpdocs directory where my SQL file would be located.

Your command would be similar to this depending on your server. Ask your server admin for path information to your httpdocs directory if you need it. If your SQL file is located here, you’re half way done!

Using the dir command, you can see what files you have in your directory. Try it now.

dir

If you see your SQL file, that’s good. If not, change your directory to find your file.

Once you’ve found your file use this command to import your SQL file to your database.

mysql -u dbusername -p databasename < backupname.sql

Make sure to change dbusername, databasename, and backupname.sql to your data.

Once you use this command, you’ll be prompted for your database password. Enter that and your database will be imported!

Congrats!

P.S. Using phpMyAdmin you can check to see that all tables have been imported and you’re good to go.

Donald

Donald

Creator of SFB, eBay Stealth and Amazon Ghost at aspkin

¯\_(oo)_/¯ My Recent Works –> eBay Stealth, Amazon Ghost, AutoBlogBook, SixFigureBoss

Donald

Donald

Donald

Latest posts by Donald (see all)

Posted on by Donald in Database, How-To

Leave a Reply

7 Comments on "Using Putty To Import A Database"

avatar
Aamer
Guest

Awesome, it worked for me. Thanks

brijin
Guest
brijin

yeahhh!!!!!!!! saved d day……

sebastian
Guest

Thank you i had a 500 mb Database and mysql dumper didn`t work you safed me alot of work here !

Jon
Guest
Jon

So glad you posted this buddy.
Dynamite code!

MrSMAK
Guest
MrSMAK

Awesome!, It worked for me. The content was very helping.
Thanks for Posting it.

Danny Fearn
Guest
Danny Fearn

thank you sooooo much hahaha!

im new to using putty and wouldnt of had a clue without this!

🙂

wpDiscuz