[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Timeout

Posted on 2001-09-14
1
Medium Priority
?
251 Views
Last Modified: 2006-11-17
Hi, I use the following code to restore a database file sql.sql and it works fine but when sql.sql file is large I got :

Fatal error: Maximum execution time of 30 seconds exceeded ...

My sql.sql file is about 15 MB is there a way to take over this problem notice that i don't have access to php.ini ??

restore.php script:
===================

<?
      $server= "localhost";
      $username="xxxx";
      $password="xxxx";
      $db="xxxx";

      $conn = mysql_connect ($server, $username, $password);
      mysql_select_db ($db, $conn);

      $file="sql.sql";
      $sql = join("", file($file));
                             
      $sql = split(";", $sql);
                               
       for($i=0;$i<count($sql);$i++)
           mysql_query($sql[$i],$conn);
?>


0
Comment
Question by:Zuhair070699
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
olegtim earned 400 total points
ID: 6484260
well I guess your sql file is a database dump, if you have the shell access you can simply do it from there, just upload the file to some directory, than go into that directory and do:

mysql DATABASENAME -uUSERNAME -pPASSWORD < sql.sql

(no spaces between the option -u and username, same for -p and password)

If you have no shell access you can do it in php with exec() like this:

<?php
exec('mysql DATABASENAME -uUSERNAME -pPASSWORD < sql.sql');
?>

let me know if it helps
olegtim
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question