0

I need to import some big sql text files (120 and 300 MB) to a local database via phpmyadmin. I succeeded at the smaller dbs, around 8 and 18 MB, but got several time-outs on the next one (120 MB).

Following a suggestion here, I inserted "$cfg['ExecTimeLimit'] = 0;" in two different places in config.inc.php, and now I got this error:

SQL query: DocumentationEdit Edit

SELECT `comment`
FROM `phpmyadmin`.`pma__column_info`
WHERE db_name = 'bot4b'
AND table_name = ''
AND column_name = '(db_comment)'

MySQL said: Documentation
#1100 - Table 'pma__column_info' was not locked with LOCK TABLES 

I commented out the "$cfg['ExecTimeLimit'] = 0;", but the error persists. I restarted apache and even rebooted.

After the boot, I created a new database, and tried to reimport the smaller one (8 MB), with the same error.

I think it's not a user/password problem, and I'm afraid to try the suggestion here without knowing what I'm doing. I prefer to understand what's happening than just applying blind fixes that could ruin the system even more. (Btw, my 'controluser' and 'controlpass' are uncommented, and set to local variables $dbuser and $dbpass as default.)

I'm using Ubuntu 14.04, Apache 2.4.7 (Ubuntu), MySQL 14.14 and PHP 5.5.9-1ubuntu4.11 (cli)

Thanks in advance.

Community
  • 1
  • 1
Rodrigo
  • 4,706
  • 6
  • 51
  • 94

2 Answers2

3

I would suggest using MySQL command line tools to do this, using web interface takes long and really you'll run into a lot of problems.

You could use:

mysql -p -u user_name database_name < file.sql

or

mysqlimport [options] db_name textfile1
Amin
  • 663
  • 1
  • 8
  • 25
  • 1
    OK, that works. But what exactly happened to phpmyadmin, that was able to import my 8MB database, and now is not? – Rodrigo Jul 24 '15 at 18:03
0

You could do this.

Basically add some php config to the phpmyadmin alias configuration that will increase various php parameters just while you are using phpMyAdmin.

I am not ubuntu expert but I think the alias is defined in /etc/phpmyadmin/apache.conf

If you add these parameters to the <Directory.... </Directory>

<Directory ......>

  . . .

  . . . 
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149