Asked  7 Months ago    Answers:  5   Viewed   32 times

I have an XML document that has around 48,000 children (~50MB). I run an INSERT MYSQL query that makes new entries for each one of these children. The problem is that it takes a lot of time due to its size. After it is executed I receive this

Fatal error: Maximum execution time of 60 seconds exceeded in /path/test.php on line 18

How do I set the Maximum execution time to be unlimited?

Thanks

 Answers

51

You can make it by setting set_time_limit in you php code (set to 0 for no limit)

set_time_limit(0);

Or modifying the value of max_execution_time directly in your php.ini

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 120  

Or changing it with ini_set()

ini_set('max_execution_time', 120); //120 seconds

but note that for this 3rd option :

max_execution_time

You can not change this setting with ini_set() when running in safe mode. The only workaround is to turn off safe mode or by changing the time limit in the php.ini.

Source www.php.net

Wednesday, March 31, 2021
 
KingCrunch
answered 7 Months ago
71

you can't print the result from mysqli_query, it is mysqli_resource and for dumping the error you need to change mysql_error() to mysqli_error()

$username = "bob";
$db = mysqli_connect("localhost", "username", "password", "user_data");
$sql1 = "select id from user_information where username='$username'";
$result = mysqli_query($db, $sql1) or die(mysqli_error());
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { 
    echo $row['id'].'<br>'; 
} 
Saturday, May 29, 2021
 
pamelus
answered 5 Months ago
91

I have the same error, please go to

xamppphpMyAdminlibrariesconfig.default.php

Look for : $cfg['ExecTimeLimit'] = 600;

You can change '600' to any higher value, like '6000'.

Maximum execution time in seconds is (0 for no limit).

This will fix your error.

Wednesday, June 2, 2021
 
Asnexplore
answered 5 Months ago
39

yo need create the user "pma" in mysql or change this lines(user and password for mysql):

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma'; 
$cfg['Servers'][$i]['controlpass'] = '';

Linux: /etc/phpmyadmin/config.inc.php

Tuesday, July 13, 2021
 
ShadowZzz
answered 4 Months ago
74

You can try to use mysql console.

  1. Run cmd command
  2. Type c: or d: on command prompt. This will be based on your WAMP server installations.
  3. Assuming you have installed wamp on D: drive.
  4. D:>cd wamp
  5. D:wamp>cd bin
  6. D:wampbin>cd mysql
  7. D:wampbinmysql>cd mysql15.1.36
  8. D:wampbinmysqlmysql15.1.36>cd bin
  9. D:wampbinmysqlmysql15.1.36bin>mysql.exe -u root
  10. use database
  11. source source.sql

Bassicaly you login into mysql, use database determines which database you want to use, source /source/to/source.sql determines which sql you want to run. Pretty easy and efficient.

Thursday, September 23, 2021
 
DanMark
answered 1 Month ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :