phpmyadmin times out and doesn't keep a query number to restart from

Events happening in the community are now at Drupal community events on www.drupal.org.
Benj's picture

I'm using quickstart 0.8. I wasn't sure where to go for this question, so I thought I'd put it here. I'm trying to import an sql file using phpmyadmin. It's a large file so phpmyadmn times out. This usually isn't a problem. But for some reason phpmyadmin isn't keeping a query number to restart from, nor does it print that number to the screen. All it gives is the error saying the script times out and you can restart. I restart it but it seems as though the import starts at the beginning and ends up in the same place - the same table anyway.

I've tried increasing the timeout time by increasing in the php.ini file upload_max_filesize, memory_limit, and post_max_size. None of that seems to have done anything.

I tried just putting a guess in the 'number of records to skip' but then I get errors, as would be expected.

So, does anyone know what I need to do in quickstart to make phpmyadmin behave the way it normally does - remembering the last query. Or does anyone know how to increase the time-out time?

quickstart is a great project.

Thanks.

Comments

Check out the command line

MichaelCole's picture

Hi Horse,

Check out the command line for this. You can bypass all of PHP and phpmyadmin and get right to the database.

Drush has some built-in commands that are very helpful for this. For example, here's a db backup/restore script I wrote for use with drush. It's purpose was to put the database back to a "fresh after install" state. I wanted to use this instead of re-installing to save time. For it to make sense, I run this after each install, before I start changing things. This makes the first backup which I restore later.

quickstart@qs09:~/websites$ cat ./reinstall_me.sh
#!/bin/bash

cd ~/websites/$1

if [ ! -f backup.sql ]    # check if a backup already exists.  If not, make one.
then
  drush -y cc all          # clear all caches
  drush sql-dump --result-file=backup.sql    # dump the database to backup.  Shells 'mysqldump' command
fi

drush sql-drop -y        # drop all tables in the database
drush sql-connect < backup.sql   # restore the backup.  note the ` (ticks).  They cause the result of the command to be executed.  Run drush sql-connect without them to understand.
drush -y cc all             # clear the cache

Cheers,

Mike

Indeed, there are other ways

Benj's picture

Indeed, there are other ways to import a database. I would use the mysql terminal, but I have several websites on shared hosts where my only way to reach mysql is through phpmyadmin. And I like to run into as many problems as I can on the local setup before I get stuck with a problem on the production server. And I've often found problems with databases, or with importing/exporting data through mysql, when making changes/updates to a website.

Why would phpmyadmin be missing this regular ability on quickstart?

Hi HorseEatingWeeds, If your

MichaelCole's picture

Hi HorseEatingWeeds,

If your hosting company doesn't have command line, then consider upgrading. Saving a few bucks on hosting can really be expensive when you account for the value of your and my time. Especially when you're using it as production.

I don't think phpmyadmin or Quickstart is "missing this". This feature in phpmyadmin is klunky and might need some finesse.

You need to investigate it yourself though. I don't have experience working with hosting without shell access. If you don't want to debug it, try upgrading to a newer version of Quickstart.

If you find a solution and think it should be in Quickstart, write it up and I'll add it.

Mike

Quickstart Drupal Development Environment

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: