5

I am using phpmyadmin for my MySQL administration. When I'm doing an expensive query, which takes several minutes, phpmyadmin seems to block all other activities going on in other tabs. I can still use the mysql console for queries, but I can't use phpmyadmin anymore in any tab, it loads and finish only when the big query in the other tab is finished. Can I change this somehow?

Thomas
  • 10,289
  • 13
  • 39
  • 55

3 Answers3

6

That's because of the way php handles sessions. One session can only be used by one script at a time. In one browser all tabs use the same session so they have to wait for the task to complete.

If you log in to phpMyAdmin in another browser, you have create a new session and can do things in parallel. (Because each browser has its own cookie store)

flo
  • 1,988
  • 12
  • 15
2

Phpmyadmin is designed to be a single session through the webserver into the database. If you need to be supportive of more sessions, then you must use a client (console, sqlyog, toad) to be able to use multiple threads on the database, or use another browser so it has another session handler at the same time.

Craig Trombly
  • 464
  • 2
  • 9
  • Interestingly enough, you can have another browser open with phpmyadmin with the same user and pwd and still do things. – Craig Trombly Mar 20 '12 at 14:45
  • It is wrong. PHPMyAdmin has nothing to do with single-threading. It's, like @flo said, because of the default session handler in PHP. It's blocking. – Vladislav Rastrusny Mar 20 '12 at 14:51
  • Whoever voted me DOWN is wrong. PHP cannot handle multithreading, THEREFORE a single SESSION is a THREAD. Stupid people often criticize others over trying to be helpful. You are wrong. – Craig Trombly Mar 20 '12 at 18:23
  • http://stackoverflow.com/questions/70855/how-can-one-use-multi-threading-in-php-applications – Craig Trombly Mar 20 '12 at 18:31
  • 1
    PHP cannot handle multithreading. But a single session is not a thread. Depending on a PHP configuration, one session can be a thread or a proces, for example. PHPMyAdmin blocks exactly because PHP default session handler locks session file until a script finishes execution. But if you choose another non-blocking session handler (memcached or whatever), you will be able to use phpMyAdmin doing complex tasks in several windows at the same time. – Vladislav Rastrusny Mar 21 '12 at 11:45
1

As this still seems to be quite popular, let me add up to date answer.

Since phpMyAdmin 4.5.0 the session is not locked while executing SQL query (and other possibly long lasting operations). See https://github.com/phpmyadmin/phpmyadmin/issues/5699 for more information.

Michal Čihař
  • 9,799
  • 6
  • 49
  • 87
  • I'm not sure it's fully fixed. When I execute a long-running query in Chrome I often can't open another phpmyadmin tab in chrome, but can in Firefox. That's on v4.9.0.1 – Íhor Mé Aug 26 '19 at 13:59