php 加载 innoDB 数据库主页时,phpMyAdmin 非常慢

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21325229/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 04:03:19  来源:igfitidea点击:

phpMyAdmin EXTREMELY slow when loading innoDB database main page

phpmysqldatabaseapachephpmyadmin

提问by pfuri

My Problem I am Having:

我遇到的问题:

I load the database page for one of my innoDB databases from within phpMyAdmin and it loads EXTREMELY slow. We're talking like up to 5 minutes of load time. This only happens on the MAIN page, meaning, when you view the database and the left sidebar that shows all the tables shows up.

我从 phpMyAdmin 中加载了我的一个 innoDB 数据库的数据库页面,但加载速度非常慢。我们正在谈论最多 5 分钟的加载时间。这仅发生在 MAIN 页面上,也就是说,当您查看数据库时,显示所有表格的左侧边栏会出现。

After that initial load time, each individual table can be clicked on and load almost immediately. But those tables are loaded in an iframe without reloading the left sidebar of database tables which is why they load so quickly.

在初始加载时间之后,可以单击每个单独的表并几乎立即加载。但是这些表是在 iframe 中加载的,而无需重新加载数据库表的左侧边栏,这就是它们加载如此之快的原因。

After that initial load time, each individual table can be opened in a new tab/window immediately, but doing it that way does not include the left sidebar of database tables, which I am sure is the reason they load so quickly.

在初始加载时间之后,每个单独的表都可以立即在新选项卡/窗口中打开,但这样做不包括数据库表的左侧边栏,我确信这就是它们加载如此之快的原因。

What I Expect To Be Happening:

我期望发生的事情:

I expect to be able to load the main page of my innoDB database from within phpMyAdmin without it taking 5 minutes to load.

我希望能够从 phpMyAdmin 中加载我的 innoDB 数据库的主页,而不会花费 5 分钟来加载。

What I've tried:

我试过的:

I've had this issue for months and it drives me crazy every day. I've come to live with it actually. I simply load that initial page immediately every day, and go do something else so i don't have to watch it, because it just makes me angry.

我已经有这个问题几个月了,它每天都让我发疯。我真的接受了它。我只是每天立即加载初始页面,然后去做其他事情,这样我就不必看它了,因为它只会让我生气。

I have my timeout set to about 15 minutes, so if I think its been longer than 10 minutes, I will open where it says "localhost" in a different tab, which brings me to the login screen, log back in, and then it brings me to the list of databases, which loads quickly. This is because if I simply load that main page, then log in, it will bring me back to that index page and i'll wait another 5 minutes for it to load. Grr..

我将超时设置为大约 15 分钟,所以如果我认为它超过 10 分钟,我将在不同的选项卡中打开显示“localhost”的位置,这会将我带到登录屏幕,重新登录,然后它将我带到快速加载的数据库列表。这是因为如果我只是加载该主页,然后登录,它会将我带回该索引页面,我将再等待 5 分钟以加载它。呃..

OK so, I Googled and Googled and found tons of suggestions about making innoDB not do row counts and stuff like that. I've tried all of them. Nothing is working! :(

好吧,我在谷歌上搜索并搜索了大量关于使 innoDB 不进行行计数之类的建议。我已经尝试了所有这些。什么都不起作用!:(

I found something called "$cfg['Server']['IgnoreSomeISrows'] = true;" which did not help whatsoever. I don't even know what it did, but it didn't work, so I removed it, but I forgot to remove that part and so I just left it there. No, commenting it out does not help either thank you.

我发现了一个叫做“$cfg['Server']['IgnoreSomeISrows'] = true;”的东西 这没有任何帮助。我什至不知道它做了什么,但它不起作用,所以我删除了它,但我忘记删除那部分,所以我只是把它留在那里。不,评论它也无济于事,谢谢。

Some Version Info:

一些版本信息:

OS

操作系统

CentOS release 6.5 (Final)

Database:

数据库:

Server: Localhost via UNIX socket
Software: MySQL
Software version: 5.1.71-log - Source distribution
Protocol version: 10

Web Server

网络服务器

Apache/2.2.15 (CentOS)
Database client version: libmysql - 5.1.71
PHP extension: mysqli Documentation

phpMyAdmin

phpMyAdmin

Version information: 3.5.8.2, latest stable version: 4.1.5

采纳答案by Tom Kim

Personally I also experience extremely slow with phpmyadmin, when I view in "View" Table. What I did is upgrade the phpmyadmin to the latest version, then my problem is solved. Maybe u can give a try for phpymadmin v4

就个人而言,当我在“查看”表中查看时,使用 phpmyadmin 的速度也非常慢。我所做的是将phpmyadmin升级到最新版本,然后我的问题就解决了。也许你可以试试 phpymadmin v4

回答by pfuri

Thank you Tom Kim for leading me to the answer.

感谢 Tom Kim 带领我找到答案。

There wasn't enough room in comments so I will elaborate with an additional answer on exactly what I did to solve my issue. I do not know why the yum version of phpMyAdmin was causing me distress.

评论中没有足够的空间,所以我将详细说明我为解决问题所做的工作。我不知道为什么 yum 版的 phpMyAdmin 让我很苦恼。

  1. backup your config file (if you have made one)
  2. remove the yumversion(s) of phpMyAdmin(there are 2 different ones)
  3. download the latest version of phpMyAdminfrom their website
  4. unzip it and move it into the normalplace
  5. replace (or create) the config file
  6. add a virtual host entry for it and make sure to restrict access to you ONLY YOUR IP ADDRESSfor security purposes
  7. restart Apache
  8. Have some tequila to celebrate! preferably reposado because it's the best type :) (this part is VERY important)
  1. 备份你的配置文件(如果你已经做了一个)
  2. 删除phpMyAdminyum版本(有 2 个不同的版本)
  3. 从他们的网站下载最新版本的phpMyAdmin
  4. 解压并移动到正常位置
  5. 替换(或创建)配置文件
  6. 为它添加一个虚拟主机条目,并确保出于安全目的限制对您的 IP 地址的访问
  7. 重启阿帕奇
  8. 喝点龙舌兰酒庆祝一下!最好是 reposado 因为它是最好的类型 :) (这部分非常重要)

Here is my answer in bash form:

这是我以 bash 形式给出的答案:

(I assume you have phpMyAdmin or phpmyadmin already installed and configured... I won't give you a config file, but I'll give you the vhost file, its mostly based on the one from the yum version of phpMyAdmin):

(我假设你已经安装并配置了 phpMyAdmin 或 phpmyadmin...我不会给你一个配置文件,但我会给你 vhost 文件,它主要基于 phpMyAdmin 的 yum 版本)

mkdir /tmp/phpMyAdminNew;
cp /usr/share/phpMyAdmin/config.inc.php /tmp/phpMyAdminNew/config.inc.php;
yum remove phpMyAdmin phpmyadmin;
cd /tmp;
wget -O /tmp/phpMyAdminNew/phpMyAdmin-4.1.5-all-languages.zip http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.1.5/phpMyAdmin-4.1.5-all-languages.zip;
unzip -d /tmp/phpMyAdminNew /tmp/phpMyAdminNew/phpMyAdmin-4.1.5-all-languages.zip;
mv /tmp/phpMyAdminNew/phpMyAdmin-4.1.5-all-languages /usr/share/phpMyAdminNew
cp /tmp/phpMyAdminNew/config.inc.php /usr/share/phpMyAdminNew/config.inc.php
echo -e 'Alias /my_secret_phpmyadmin_portal /usr/share/phpMyAdminNew\n\n<Directory /usr/share/phpMyAdminNew/>\n\t<IfModule mod_authz_core.c>\n\t\t# Apache 2.4\n\t\t<RequireAny>\n\t\t\tRequire ip 127.0.0.1\n\t\t\tRequire ip ::1\n\t\t\t# Require ip xxx.xxx.xxx.xxx\n\t\t</RequireAny>\n\t</IfModule>\n\t<IfModule !mod_authz_core.c>\n\t\t# Apache 2.2\n\t\tOrder Deny,Allow\n\t\tDeny from All\n\t\tAllow from 127.0.0.1\n\t\tAllow from ::1\n\t\t# Allow from xxx.xxx.xxx.xxx\n\t</IfModule>\n</Directory>\n\n<Directory /usr/share/phpMyAdminNew/setup/>\n\t<IfModule mod_authz_core.c>\n\t\t# Apache 2.4\n\t\t<RequireAny>\n\t\t\tRequire ip 127.0.0.1\n\t\t\tRequire ip ::1\n\t\t\t# Require ip xxx.xxx.xxx.xxx\n\t\t</RequireAny>\n\t</IfModule>\n\t<IfModule !mod_authz_core.c>\n\t\t# Apache 2.2\n\t\tOrder Deny,Allow\n\t\tDeny from All\n\t\tAllow from 127.0.0.1\n\t\tAllow from ::1\n\t\t# Allow from xxx.xxx.xxx.xxx\n\t</IfModule>\n</Directory>\n\n# These directories do not require access over HTTP - taken from the original\n# phpMyAdmin upstream tarball\n\n<Directory /usr/share/phpMyAdminNew/libraries/>\n\tOrder Deny,Allow\n\tDeny from All\n\tAllow from None\n</Directory>\n\n<Directory /usr/share/phpMyAdminNew/setup/lib/>\n\tOrder Deny,Allow\n\tDeny from All\n\tAllow from None\n</Directory>\n\n<Directory /usr/share/phpMyAdminNew/setup/frames/>\n\tOrder Deny,Allow\n\tDeny from All\t\nAllow from None\n</Directory>\n\n# This configuration prevents mod_security at phpMyAdmin directories from\n# filtering SQL etc.  This may break your mod_security implementation.\n#\n#<IfModule mod_security.c>\n#\t<Directory /usr/share/phpMyAdminNew/>\n#\t\tSecRuleInheritance Off\n#\t</Directory>\n#</IfModule>' > /etc/httpd/conf.d/phpMyAdminNew.conf;
rm -rf /tmp/phpMyAdminNew
service httpd graceful
clear; echo -e '\n\n##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##\n ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##\n  ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##\n   ##~~~~~~~~~~~~~~~~~~~~~~~~~~~##\n    ##~~~~~~~~~~~~~~~~~~~~~~~~~##\n     ##~~~~~~~~~~~~~~~~~~~~~~~##\n      ##~~~~~~~~~~~~~~~~~~~~~##\n       ##~~~~~~~~~~~~~~~~~~~##\n        ###~~~~~~~~~~~~~~~###\n         ####~~~~~~~~~~~####\n          #####~~~~~~~~#####\n          ##################\n          ## TEQUILA SHOT ##\n          ##################\n\n';