SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)

    attempting to import 300MB sql file with mysqlimport

    I'm trying to import a .sql file that was dumped from one server and import it into an empty database on a windows dev box running XAMPP.

    Normally, I would use phpmyadmin, but the file is 300+ MB in size.

    The create statements and insert statements are all there.

    Going to the command line, I can get to the mysqlimport bin file, but every time I try typing in the command for the actual import, it spits back the text of the help file like I missed something in the command's syntax.

    I copied the .sql file into the bin directory to eliminate issues I might have been having with the filepath.

    Here's what I've attempted:

    Code:
    mysqlimport -u THEUSER -p THEPASSWORD THEDATABASENAME THEFILE.sql
    Code:
    mysqlimport -u THEUSER -p THEPASSWORD THEDATABASENAME  < THEFILE.sql
    Any ideas as to what's missing or incorrect?
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    Looks like I was using the -u and -p options incorrectly. New command, and a new error:

    Code:
    mysqlimport --user=THEUSER -p THEDBNAME THEFILE.sql
    Code:
    mysqlimport: Error: 1146, Table 'THEDBNAME.THEDBNAME' doesn't exist, when using table: THEDBNAME
    Suggestions brought up in google say to include an angle bracket:

    Code:
    mysqlimport --user=THEUSER -p THEDBNAME < THEFILE.sql
    But this just produces the help file output again like there's a syntax error.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    Got it:

    Code:
    mysql --user=THEUSER -p THEDBNAME < THEFILE.sql
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •