Skip to content

Instantly share code, notes, and snippets.

@asvae
Created May 3, 2016 18:18
Show Gist options
  • Save asvae/a817061dc50c44aca7d000f4da57435a to your computer and use it in GitHub Desktop.
Save asvae/a817061dc50c44aca7d000f4da57435a to your computer and use it in GitHub Desktop.
fix db for mysql 5.7 import
<?php
set_time_limit ( 900000 );
$file = fopen('99board.sql', 'r+');
$i = 0;
// SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
fputs($file, 'SET SESSION sql_mode = \'ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\';' . PHP_EOL . '/*');
while ($i++ < 1000){
$line = fgets($file);
echo '<br>';
echo $line;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment