1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how to import .sql file to database, to big for phpmyadmin, no ssh

Discussion in 'MySQL' started by tyggemannen, Aug 30, 2006.

  1. #1
    How can I import a .sql file to a database, the file is to big for phpmyadmin, I dont have ssh on the server.


    Thanks, t.
     
    tyggemannen, Aug 30, 2006 IP
  2. Neptune

    Neptune Well-Known Member

    Messages:
    1,465
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Are you importing it to a shared host?
     
    Neptune, Aug 30, 2006 IP
  3. iowadawg

    iowadawg Prominent Member

    Messages:
    10,918
    Likes Received:
    811
    Best Answers:
    0
    Trophy Points:
    380
    #3
    Right now, uploading a 95mb database via phpadmin.
    Will take some time, but hopefully it will all go in.

    If there is another better, easier way, I would like to know also.
     
    iowadawg, Aug 30, 2006 IP
  4. Notorious

    Notorious Well-Known Member

    Messages:
    903
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    145
    #4
    Notorious, Aug 30, 2006 IP
  5. tyggemannen

    tyggemannen Guest

    Messages:
    842
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks, looks good, I will try that.
    (shared host, yes)
     
    tyggemannen, Aug 31, 2006 IP
  6. dddougal

    dddougal Well-Known Member

    Messages:
    676
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    108
    #6
    or try bigdump, although to be honest iv never had much success with that either. Iv found the easiest way is to upload the sql file to the server and than get the host to run the dump, they can do it in seconds.
     
    dddougal, Aug 31, 2006 IP
    northpointaiki likes this.
  7. cellularnews

    cellularnews Peon

    Messages:
    246
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I usually upload the sql file to my server then use the absolute path as the location of the file to be "uploaded" by phpmyadmin
     
    cellularnews, Aug 31, 2006 IP
  8. tyggemannen

    tyggemannen Guest

    Messages:
    842
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Bigdump didnt work. couldnt import my file, it was in a format bigdump couldnt handle.

    "I usually upload the sql file to my server then use the absolute path as the location of the file to be "uploaded" by phpmyadmin"

    I am so new to this, I tried this. you are talking about to put the absolute path beside the "browse" button right, instead of browsing ?
     
    tyggemannen, Aug 31, 2006 IP
  9. tyggemannen

    tyggemannen Guest

    Messages:
    842
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Ok, thanks I used mysqldumper.
    Now I have another problem getting error:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near" ''at line 1

    Anybody have a clue ? Thanks.
     
    tyggemannen, Sep 4, 2006 IP
  10. shenron

    shenron Notable Member

    Messages:
    4,965
    Likes Received:
    374
    Best Answers:
    0
    Trophy Points:
    295
    #10
    Line 1? Are you using compatible versions? I mean, have you dumped from a more recent version than the one the hoster has, and /or, have you checked the character set?
    Just some clues, not sure... :)
     
    shenron, Sep 4, 2006 IP
  11. tyggemannen

    tyggemannen Guest

    Messages:
    842
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Oh, it should be: (with one ", not two)

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1


    Hm, I dont know. i got this whole site content incl. a database (.sql file) for free and just want to use it.

    How do I check the character set ?

    Its my first time to try sql at all, I am blank. Sorry for so bad info. If you have any idea, please help.
     
    tyggemannen, Sep 4, 2006 IP
  12. lordlisa

    lordlisa Peon

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    tyggemanne, try MySQL Dumper which is my fav as phpmyadmin sux hxxp://www.mysqldumper.de/en/
     
    lordlisa, Sep 6, 2006 IP
  13. tyggemannen

    tyggemannen Guest

    Messages:
    842
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Hi lordliasa. I already used mysqldumper and it was ok.

    Now when I try to search in the database, i get :

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

    Do you know what it could be ?
     
    tyggemannen, Sep 6, 2006 IP
  14. amnezia

    amnezia Peon

    Messages:
    990
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #14

    It means that your query is wrong. what query are you using to search the database?
     
    amnezia, Sep 6, 2006 IP
  15. tyggemannen

    tyggemannen Guest

    Messages:
    842
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I am sorry, i am so new with this. I dont know what you mean with a query.
     
    tyggemannen, Sep 7, 2006 IP
  16. lordlisa

    lordlisa Peon

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    query is nothin but the command what you run for the mysql :)
     
    lordlisa, Sep 7, 2006 IP
  17. tyggemannen

    tyggemannen Guest

    Messages:
    842
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Thought it might be something like that, is this telling you something ?

    function browseNames($data, $page)
    {
    if ( ! $page )
    {
    $page = 1;
    }
    global $num_results, $url_prefix;
    $output = "<div id='contentColumn'>
    <div id='innerContentColumn'>";
    $SQL = "SELECT COUNT(*) FROM lyrics WHERE Artist LIKE '$data%'";
    $sth = mysql_query($SQL) or die(mysql_error());
    list( $number_results ) = mysql_fetch_row($sth);
    mysql_free_result($sth);
    if ( $number_results == 0 )
    {
    $output .= "<tr><td>We're sorry, there are no names available for the letter $data in our database.</td></tr></table>";
    return $output;
    }
    $SQL = "SELECT DISTINCT(Artist) FROM lyrics WHERE Artist LIKE '$data%' LIMIT $limit_start $num_results";
    $sth = mysql_query($SQL) or die(mysql_error());
    while ( $row = mysql_fetch_object($sth) )
    {
    $output .= "
    <div><a href='$url_prefix/name/$row->Artist.html'>$row->Artist</a></div>
    ";
    }
     
    tyggemannen, Sep 7, 2006 IP
  18. DarrenC

    DarrenC Peon

    Messages:
    3,386
    Likes Received:
    154
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Why don't you just contact your host who should do it for you if the .sql file is too large.

    If your host won't do it - get a new host.
     
    DarrenC, Sep 7, 2006 IP
  19. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #19
    if you can mysql in you can call:
    mysql -u (username) -p DatabaseName < DatabaseBackup.sql

    Navicat has also always given me good results with big SQL dumps.
     
    ccoonen, Sep 7, 2006 IP
  20. dshah

    dshah Well-Known Member

    Messages:
    1,840
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    115
    #20
    If I am not wrong phpmyadmin can't load file above 5mb (depends on how your hosting provider has set it). Your best bet is to import using command line client (you will need SSH access for it)

    Its simple command

    source <sql file name with path>
    Code (markup):
     
    dshah, Sep 7, 2006 IP