php #1193 - 尝试登录 phpmyadmin 时出现未知的系统变量“lc_messages”

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

#1193 - Unknown system variable 'lc_messages' when trying to login to phpmyadmin

phpmysqlphpmyadmin

提问by Jeremy

I have recently installed MySQL and phpMyAdmin, but when I try to login to phpMyAdmin with the root credentials I get the following error for this query:

我最近安装了 MySQL 和 phpMyAdmin,但是当我尝试使用 root 凭据登录到 phpMyAdmin 时,我收到此查询的以下错误:

SQL query:

SQL查询:

SET lc_messages = 'en_US';

MySQL said: Documentation

MySQL 说: 文档

#1193 - Unknown system variable 'lc_messages'

#1193 - 未知系统变量“lc_messages”

Why am I experiencing this error?

为什么我会遇到这个错误?

回答by Shadi Namrouti

I faced the same problem. Check your mySQL version:

我遇到了同样的问题。检查您的 MySQL 版本:

For mySQL 5.5, use phpMyAdmin 4.4.x and above

对于 mySQL 5.5,请使用 phpMyAdmin 4.4.x 及更高版本

For mySQL 5.1, use phpMyAdmin 4.0.x

对于 mySQL 5.1,使用 phpMyAdmin 4.0.x

Hope this helps someone.

希望这可以帮助某人。

回答by Krashan Brahmanjara

It isn't true. PhpMyAdmincan work with older Mysqlas always.

这不是真的。PhpMyAdmin可以Mysql像往常一样与老年人一起工作。

Quick fixis easy

快速修复很容易

  • in /usr/share/phpMyAdmin/libraries/common.inc.phpdelete these lines
  • /usr/share/phpMyAdmin/libraries/common.inc.php 中删除这些行
if (PMA_MYSQL_INT_VERSION < $cfg['MysqlMinVersion']['internal']) {
  PMA_fatalError(
    __('You should upgrade to %s %s or later.'),
    array('MySQL', $cfg['MysqlMinVersion']['human'])
  );
}

or

或者

enter image description here

在此处输入图片说明

  • in /usr/share/phpMyAdmin/libraries/classes/DatabaseInterface.phpdelete these lines
  • /usr/share/phpMyAdmin/libraries/classes/DatabaseInterface.php 中删除这些行
if (! empty($locale)) {
  $this->query("SET lc_messages = '" . $locale . "';", $link, self::QUERY_STORE);
}

Reference https://github.com/phpmyadmin/phpmyadmin/issues/12822

参考https://github.com/phpmyadmin/phpmyadmin/issues/12822

回答by archfoe

I had the same problem and here is how I fixed it:

我遇到了同样的问题,这是我修复它的方法:

  1. Upgraded mysql to latest version: http://www.tecmint.com/install-latest-mysql-on-rhel-centos-and-fedora/

  2. After the upgrade mysql service couldn't start. Here's the fix:
    mysqld_safe --skip-grant-tables
    mysql_upgrade

  1. 将 mysql 升级到最新版本:http: //www.tecmint.com/install-latest-mysql-on-rhel-centos-and-fedora/

  2. 升级后mysql服务无法启动。这是修复:
    mysqld_safe --skip-grant-tables
    mysql_upgrade

回答by David Silvestre

Uninstall your mysql version and all dependencies. To see all your mysql and dependencies packages installeds try this command:

卸载您的 mysql 版本和所有依赖项。要查看已安装的所有 mysql 和依赖项包,请尝试以下命令:

- rpm -qa | grep mysql

For uninstall:

对于卸载:

- yum erase mysql
- yum erase mysqlPackageDependencie
...

When all dependencies are uninstalled install the new mysql version:

卸载所有依赖项后,安装新的 mysql 版本:

- yum install mysql55-server

Start your Service Mysql:

启动您的服务 Mysql:

- service mysqld start

Great! All works perfect now! :)

伟大的!现在一切正常!:)

回答by Jeremy

I found that I had an older version of phpmyadmin and the error was because of a change they had made to PHP 7.

我发现我有一个旧版本的 phpmyadmin,错误是因为他们对 PHP 7 进行了更改。

If your running any version of php 5.5 or higher you will get this error unless you update your phpmyadmin.

如果您运行任何版本的 php 5.5 或更高版本,除非您更新 phpmyadmin,否则您将收到此错误。

回答by Scriptslayer

I followed Krashan Brahmanjara's instructions. And I deleted

我遵循了 Krashan Brahmanjara 的指示。我删除了

    if (! empty($locale)) { $this->query("SET lc_messages = '" . $locale . "';", $link, self::QUERY_STORE);
}

I also deleted if ($GLOBAL

我也删了 if ($GLOBAL

enter image description here

在此处输入图片说明