MySQL phpmyadmin 在 1440 秒后注销

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13697820/
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-31 15:39:42  来源:igfitidea点击:

phpmyadmin logs out after 1440 secs

mysqldjangophpmyadmintimeoutlogout

提问by sandeep

In my local development Ubuntu box I use MySQL and phpmyadmin to work with the database.

在我的本地开发 Ubuntu 框中,我使用 MySQL 和 phpmyadmin 来处理数据库。

Whenever phpmyadmin is idle for 1440 secs (24min) the session expires. I lose my place and have to login and start over.

每当 phpmyadmin 空闲 1440 秒(24 分钟)时,会话就会过期。我失去了我的位置,必须登录并重新开始。

I tried changing the $cfg['LoginCookieValidity'] = 3600 * 9;inside config.inc.phpbut it still times out in 1440 seconds.

我尝试改变$cfg['LoginCookieValidity'] = 3600 * 9;内部,config.inc.php但它仍然在 1440 秒内超时。

I have restarted everything and cleared the browser cache (Firefox history -> Clear recent history -> Cache -> Everything).

我已经重新启动了所有内容并清除了浏览器缓存(Firefox 历史记录 -> 清除最近历史记录 -> 缓存 -> 一切)。

I'm not sure why the increased timeout does not take effect. What am I doing wrong?

我不确定为什么增加的超时没有生效。我究竟做错了什么?

采纳答案by sandeep

I have found the solution and using it successfully for sometime now.

我已经找到了解决方案并成功使用了一段时间。

Just install this Addonto your FF browser.

只需将此插件安装到您的 FF 浏览器即可。

回答by Pavnish Yadav

Go to PHPMyAdmin in your browser

在浏览器中转到 PHPMyAdmin

Settings > Features > Change the value of Login cookie validity > Saveenter image description here

设置 > 功能 > 更改登录 cookie 有效性的值 > 保存在此处输入图片说明

NOTE: You will have to do this per session.

注意:您必须在每个会话中执行此操作。

回答by Phil LaNasa

Add this line to /config.inc.php:

将此行添加到 /config.inc.php:

$cfg['LoginCookieValidity'] = 36000;

In /setup/lib/index.lib.php

在 /setup/lib/index.lib.php

$cf->getValue('LoginCookieValidity') > 36000;

If you don't already have a .htaccess file for your phpMyAdmin site, create one, and add the following line to override the default PHP session timeout:

如果您的 phpMyAdmin 站点还没有 .htaccess 文件,请创建一个,并添加以下行以覆盖默认的 PHP 会话超时:

php_value session.gc_maxlifetime 36000

I would not recommend altering this value in your main php.ini file, as it will allow a ridiculously long session timeout for all your PHP sites.

我不建议在您的主 php.ini 文件中更改此值,因为它会允许您所有 PHP 站点的会话超时时间长得可笑。

source: http://www.sitekickr.com/blog/increase-phpmyadmin-timeout/

来源:http: //www.sitekickr.com/blog/increase-phpmyadmin-timeout/

回答by flashMark

We can change the cookie time session feature at:

我们可以在以下位置更改 cookie 时间会话功能:

Settings->Features->General->Login cookie validity

设置->功能->通用->登录cookie有效性

I found the answer in here.. No activity within 1440 seconds; please log in again

我在这里找到了答案.. 1440 秒内没有活动;请重新登录

EDIT:

编辑:

This solution will work only for the current session, to change permanently do:

此解决方案仅适用于当前会话,要永久更改:

open config.inc.php in the root phpMyAdmin directory .

打开 phpMyAdmin 根目录中的 config.inc.php。

wamp folder: wamp\apps\phpmyadmin{version}\config.inc.php

wamp 文件夹:wamp\apps\phpmyadmin{version}\config.inc.php

ubuntu: /etc/phpmyadmin

ubuntu:/etc/phpmyadmin

add this line

添加这一行

$cfg['LoginCookieValidity'] = <your_timeout>;

Example

例子

$cfg['LoginCookieValidity'] = '144000';

回答by Foreever

You can change the cookie time session feature at phpmyadmin web interface

您可以在 phpmyadmin Web 界面更改 cookie 时间会话功能

Settings->Features->General->Login cookie validity

OR

或者

If you want to change the 'login cookie validity' in configuration file, then open the phpmMyAdmin configuration file, config.inc.phpin the root directory of PHPMyAdmin.(root directory is usually /etc/phpmyadmin/)

如果要更改配置文件中的“登录cookie有效性”,则打开phpmMyAdmin配置文件,config.inc.php在PHPMyAdmin的根目录下。(根目录通常是/etc/phpmyadmin/)

After locating the config.inc.php , search for the line below and set it to the value of seconds you want phpmyadmin to timeout:

找到 config.inc.php 后,搜索下面的行并将其设置为您希望 phpmyadmin 超时的秒数:

$cfg['LoginCookieValidity'] 

or

或者

Add the following:

添加以下内容:

$cfg[ ' Servers'] [$i] [ ' LoginCookieValidity' ] = <your_new_timeout>;

For example:

例如:

$cfg[ ' Servers'] [$i] [ ' LoginCookieValidity' ] = <3600 * 3 >;

The Timeout is set to 3 Hours from the Example above.

上例中的超时设置为 3 小时。

session.gc_maxlifetimemight limit session validity and if the session is lost, the login cookie is also invalidated. So, we may need to set the session.gc_maxlifetime in php.iniconfiguration file(file location is /etc/php5 /apache2/php.ini in ubuntu).

session.gc_maxlifetime可能会限制会话有效性,如果会话丢失,登录 cookie 也会失效。因此,我们可能需要在php.ini配置文件中设置 session.gc_maxlifetime (文件位置在 ubuntu 中为 /etc/php5 /apache2/php.ini)。

session.gc_maxlifetime = 3600 * 3



phpMyAdmin Documentation on LoginCookieValidity关于 LoginCookieValidity 的 phpMyAdmin 文档


$cfg['LoginCookieValidity']

$cfg['LoginCookieValidity']

Type: integer [number of seconds]
Default value: 1440

类型: 整数 [秒数]
默认值: 1440

Define how long a login cookie is valid. Please note that php configuration option session.gc_maxlifetime might limit session validity and if the session is lost, the login cookie is also invalidated. So it is a good idea to set session.gc_maxlifetime at least to the same value of $cfg['LoginCookieValidity'].

定义登录 cookie 的有效期。请注意,php 配置选项 session.gc_maxlifetime 可能会限制会话有效性,如果会话丢失,登录 cookie 也会失效。因此,最好将 session.gc_maxlifetime 设置为至少与 $cfg['LoginCookieValidity'] 相同的值。

NOTE:

笔记:

  1. If your server crashed and cannot load your phpmyadmin page, check your apache log at /var/log/apache2/error.log. If you got PHP Fatal error: Call to a member function get() on a non-object in /path/to/phpmyadmin/libraries/Header.class.phpon line 135, then do a chmod 644 config.inc.php. that should take care of the error.
  2. You will then get another warning: Your PHP parameter session.gc_maxlifetime is lower that cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.. then change the session.gc_maxlifetimeas mentioned above.
  1. 如果您的服务器崩溃并且无法加载您的 phpmyadmin 页面,请在 /var/log/apache2/error.log 检查您的 apache 日志。如果你PHP Fatal error: Call to a member function get() on a non-object in /path/to/phpmyadmin/libraries/Header.class.php在第 135 行,那么做一个chmod 644 config.inc.php. 这应该处理错误。
  2. 然后您将收到另一个警告:Your PHP parameter session.gc_maxlifetime is lower that cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.。然后session.gc_maxlifetime如上所述更改。

回答by Smith

There seems to be UI for changing phpmyadmin configurations Start apache and click the following link

似乎有用于更改 phpmyadmin 配置的 UI 启动 apache 并单击以下链接

http://localhost/phpmyadmin/setup/index.php?page=form&formset=Features#tab_Security

http://localhost/phpmyadmin/setup/index.php?page=form&formset=Features#tab_Security

回答by Mojtaba Rezaeian

Steps for doing this using phpMyAdmin settingswithout any problem or requirements to change configs in php my.ini or defining .htaccess file:

执行此操作的步骤phpMyAdmin settings没有任何问题或要求更改 php my.ini 中的配置或定义 .htaccess 文件:

  1. Goto your phpMyAdmininstall path (ex. /usr/share/phpMyAdmin/on my centos7) and find create_tables.sqlin one of its subfolders (phpMyAdmin/sql/create_tables.sqlin my 4.4.9 version.) and execute whole file contents on your current phpMyAdmin site from your web browser. This will create a database named phpmyadminwhich can keep all your phpMyAdmin options saved permanently.
  2. In phpMyAdmin's config.inc.php(located on /etc/phpMyAdmin/in my centos7 server) find the commented line $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';and uncomment it (Now phpMyAdmin will use that custom database we generated in previous step).
  3. Goto phpMyAdminfrom web browser and goto Server >> Settings >> Features >> "Login Cookie Validity"as in picture described by Pavnish and set the desired value. It works now.
  1. 转到您的phpMyAdmin安装路径(例如我的 centos7 上的/usr/share/phpMyAdmin/)并create_tables.sql在其子文件夹之一(phpMyAdmin/sql/create_tables.sql在我的 4.4.9 版本中)中找到并从您的 Web 浏览器执行当前 phpMyAdmin 站点上的整个文件内容。这将创建一个名为的数据库phpmyadmin,该数据库可以永久保存您的所有 phpMyAdmin 选项。
  2. 在 phpMyAdmin config.inc.php(位于我的 centos7 服务器中的/etc/phpMyAdmin/)中,找到注释行$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';并取消注释(现在 phpMyAdmin 将使用我们在上一步中生成的自定义数据库)。
  3. 转到phpMyAdmin从web浏览器并转到Server >> Settings >> Features >> "Login Cookie Validity"如在图描述由Pavnish和设置所需的值。它现在有效。

References: Niccolas Answer,PhpMyAdmin Configuration Storage, flashMarks Answer

参考资料Niccolas AnswerPhpMyAdmin配置存储flashMarks Answer

回答by apis17

You will then get another warning: “Your PHP parameter session.gc_maxlifetime is lower that cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.“. That makes sense because php's session will time out first anyways. So we will need to change /etc/php.ini .

然后您将收到另一个警告:“您的 PHP 参数 session.gc_maxlifetime 低于 phpMyAdmin 中配置的 cookie 有效性,因此,您的登录名将比 phpMyAdmin 中配置的更早过期。”。这是有道理的,因为 php 的会话无论如何都会先超时。所以我们需要改变 /etc/php.ini 。

session.gc_maxlifetime = 43200
That's 12 hours in seconds. 

Restart your apache server and you are done!

重新启动您的 apache 服务器,您就完成了!

source: http://birdchan.com/home/2011/06/06/phpmyadmin-timeout-after-1440-seconds/

来源:http: //birdchan.com/home/2011/06/06/phpmyadmin-timeout-after-1440-seconds/

this works for me! :)

这对我有用!:)

回答by 0xmtn

You should restart apache or httpd, not mysqld

您应该重新启动 apache 或 httpd,而不是 mysqld

sudo service httpd restart

or

或者

sudo /etc/init.d/apache2 restart

回答by Ravi Delixan

You just Increase the phpMyAdmin Session Timeout, open config.inc.php in the root phpMyAdmin directory and add this line.

您只需增加 phpMyAdmin 会话超时,打开 phpMyAdmin 根目录中的 config.inc.php 并添加这一行。

from the wamp folder pathwamp\apps\phpmyadmin4.0.4\config.inc.php

从 wamp 文件夹路径wamp\apps\phpmyadmin4.0.4\config.inc.php

$cfg['LoginCookieValidity'] = <your_timeout>;

Example

例子

$cfg['LoginCookieValidity'] = '1440';

Note:short cookie lifetime is all well and good for the development server not for your production server.

注意:对于开发服务器而言,较短的 cookie 生命周期对您的生产服务器来说都很好。

回答by ekta chauhan

1) Login to phpMyAdmin 2) From the home screen click on "More settings" (middle bottom of screen for me) 3) Click the "Features" tab/button towards the top of the screen. 4) For 20 days set the "Login cookie validity" setting to 1728000 5) Apply.

1) 登录到 phpMyAdmin 2) 在主屏幕上单击“更多设置”(对我来说是屏幕的中间底部) 3) 单击屏幕顶部的“功能”选项卡/按钮。4) 对于 20 天,将“登录 cookie 有效期”设置为 1728000 5) 应用。

php xampp

php xampp