16

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:

SQL query:

SET lc_messages = 'en_US';

MySQL said: Documentation

#1193 - Unknown system variable 'lc_messages'

Why am I experiencing this error?

Blue
  • 22,608
  • 7
  • 62
  • 92
Jeremy
  • 161
  • 1
  • 1
  • 4
  • 1
    http://stackoverflow.com/questions/14678934/mysql-error-code-1193-unknown-system-variable – sixtytrees Jun 28 '16 at 19:28
  • Maybe I am not understanding your response butt his doesn't represent the same error nor does it tell me what to change. I have not edited any code for any of the phpmyadmin pages. – Jeremy Jun 30 '16 at 12:39
  • 1
    Please include version information in your [question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/) when asking about specific software. – outis Aug 01 '16 at 01:40

7 Answers7

26

I faced the same problem. Check your mySQL version:

For mySQL 5.5, use phpMyAdmin 4.4.x and above

For mySQL 5.1, use phpMyAdmin 4.0.x

Hope this helps someone.

Shadi Alnamrouti
  • 11,796
  • 4
  • 56
  • 54
19

It isn't true. PhpMyAdmin can work with older Mysql as always.

Quick fix is easy

  • in /usr/share/phpMyAdmin/libraries/common.inc.php delete these lines
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.php delete these lines
if (! empty($locale)) {
  $this->query("SET lc_messages = '" . $locale . "';", $link, self::QUERY_STORE);
}

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

  • This got me out of a bind when I upgraded PMA prior to MySQL upgrade but needed to take database backups -- very handy *temporary* fix! Thanks for highlighting it. – Chris Woods Mar 14 '18 at 15:12
  • 2
    Actually, we have to delete or comment the both codes. Btw, in the latest at the moment phpMyAdmin 4.8.5 the first condition in the first code is `if ($GLOBALS['dbi']->getVersion() < $cfg['MysqlMinVersion']['internal']) {` – stckvrw Feb 13 '19 at 18:32
  • This is the best answer. If you already have PHPMyAdmin installed, this will fix the issue. No need to load an older version. Also, please update as @stckvrw indicates. Otherwise you can't search for that line (it is line 391 for me). – Sirius_B Mar 31 '19 at 06:16
  • It took me 2 minutes to decide to stick with adminer. Bad code exposes itself quickly – Danial Dec 11 '19 at 14:50
  • its work save lots of my time. – Dilip Godhani May 06 '22 at 08:55
3

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

archfoe
  • 31
  • 1
1

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

- rpm -qa | grep mysql

For uninstall:

- yum erase mysql
- yum erase mysqlPackageDependencie
...

When all dependencies are uninstalled install the new mysql version:

- yum install mysql55-server

Start your Service Mysql:

- service mysqld start

Great! All works perfect now! :)

  • Hmm, I would think this is a bit dangerous on servers with databases already existing. I assume this solution is based on having an empty and fresh install of MySQL and so Ok to uninstall it. – Laurence Cope Feb 12 '17 at 13:04
0

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

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

Jeremy
  • 161
  • 1
  • 1
  • 4
0

I followed Krashan Brahmanjara's instructions. And I deleted

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

I also deleted if ($GLOBAL

enter image description here

Mesut Akcan
  • 899
  • 7
  • 19
0

I was having the same problem unexpectedly, but I tried the Krashan Brahmanjara 's answer's after which the lc_message error got resolved. But it was still asking me to upgrade the PHPMyAdmin.

For this,

  1. I opened services.msc and stopped MySQL service as I have MySQL Server 5.0 installed apart from XAMPP's MySQL.

(I thought of doing this after seeing the database tables on PhpMyAdmin were of my other Mysql and not the XAMPP ones.)

Upon reloading the PHPMyAdmin page, it started working with no error!

So I guess PMA was just trying to use a MySQL that was running on the computer without checking if it was the XAMPP's MySQL or not.

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32923861) – André Walker Oct 16 '22 at 19:49