SH MySql import via php

Discussion in 'PHP' started by SGBoise, Aug 29, 2008.

  1. #1
    Hello,

    I am in the middle of migrating my database to another web host and I it's been over 5 hours and I am still having problems. The main problem is that the sql file is over 70mb and everything I try I get time outs.

    The only way I was able to move this database before was using sh mysql import. Unfortunately my current web host doesn't allow sh access.

    I want to run this command in php but is there a way to pass the password when it gets prompted for it?

    $last_line = system("mysql -p -h localhost dbname < dbname.sql" , $retval);
    PHP:
    Thanks.
     
    SGBoise, Aug 29, 2008 IP
  2. ForumJoiner

    ForumJoiner Active Member

    Messages:
    762
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    83
    #2
    There are 2 other ways:

    1. Increase the time limit, by using a local .htaccess file, with the following content:
    php_value memory_limit "-1"
    php_value max_execution_time "-1"
    php_value max_input_time "-1"

    2. Use MySQL manager. It can connect using HTTP tunneling (it works without SSH).
    You just upload a php script, which is delivered with the program, then you use the interface to communicate with the script.
    They have a free version here:
    http://www.sqlmanager.net/products/mysql/manager
     
    ForumJoiner, Aug 29, 2008 IP
  3. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #3
    try to search for bigdump wich can do it all for you :) exporting and importing!
     
    EricBruggema, Aug 30, 2008 IP