Page 1 of 1

Import MySQL Command Line

PostPosted: 13. July 2011 17:47
by gward
Hello,

I'm trying to import a large database and having no luck... I'm using Cygwin to emulate the command line thing.

After logging into mysql I run this command:

databasename > pathtodatabase/databasedump.sql

Nothing happens. I've also tried importing using phpmyadmin. It keeps saying script timeout pass even though I have max_execution_time = 0 (for unlimited right?)

The database is about 700MB.

Thanks for the help!

Re: Import MySQL Command Line

PostPosted: 13. July 2011 18:32
by Altrea
the best way is to use the MySQL command line tool. => http://www.lullabot.com/blog/importexpo ... -databases

the other possibility is to use import scripts which avoid the timeout, like mysqldumper => http://www.mysqldumper.net/

Re: Import MySQL Command Line

PostPosted: 14. July 2011 18:09
by gward
Sweet, the method described at the link did the trick.

This set of commands:

SHOW DATABASES;
DROP DATABASE [DBNAME];
CREATE DATABASE [DBNAME];
USE [DBNAME];
SOURCE [/path_to_file/DBNAME].sql;

Thanks!

Re: Import MySQL Command Line

PostPosted: 14. July 2011 21:19
by Altrea
Glad it worked for you :D
You're welcome 8)