sql.lib.php
This error is caused by a line of code in /usr/share/phpmyadmin/libraries/sql.lib.php
.
If you don’t want to wait for the repositories to update with the latest version, it is strongly recommended that you manually upgrade to the latest version of phpMyAdmin yourself.
Alternatively, you can make a change to sql.lib.php
to temporarily fix the error.
Firstly, backup sql.lib.php
before editing.
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak
Edit sql.lib.php
in nano
.
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php
Press CTRL
+ W
and search for (count($analyzed_sql_results['select_expr'] == 1)
Replace it with ((count($analyzed_sql_results['select_expr']) == 1)
Save file and exit. (Press CTRL
+ X
, press Y
and then press ENTER
)
Import/Export issues
If you are also getting an error Warning in ./libraries/plugin_interface.lib.php#551
under import and export tabs:
Backup plugin_interface.lib.php
sudo cp /usr/share/phpmyadmin/libraries/plugin_interface.lib.php /usr/share/phpmyadmin/libraries/plugin_interface.lib.php.bak
Edit plugin_interface.lib.php
sudo nano /usr/share/phpmyadmin/libraries/plugin_interface.lib.php
Press CTRL
+ W
and search for if (! is_null($options) && count($options) > 0) {
If not found, try search for if ($options != null && count($options) > 0)
Replace with if (! is_null($options) && count((array)$options) > 0) {
Save file and exit. (Press CTRL
+ X
, press Y
and then press ENTER
)
Upgrading phpMyAdmin
You may be interested in an article I wrote on manually upgrading phpMyAdmin. Since the release of Ubuntu 18.04, the repositories have been slow to update with the latest version of phpMyAdmin causing many compatibility issues, so make sure you have the latest version:
Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.
Works. Thank you
Thank you! Works great.
Thank you! Works great.
a “sed” solution
sed -i "s/|s*((count($analyzed_sql_results['select_expr'])/| (1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php
thank you!!!
Thank you very much! it work in my rasberry pi 3 b+
Thank you very much! Now everything works fine on my RPI3b+!
Resolved Thanks
Thank you! Works great!
I solve the problem ^^
The sql.lib.php is in
/var/www/new/phpmyadmin/libraries
and not in
/usr/share/phpmyadmin/libraries
Not work for me.
I have tested with all variations (edit sql.lib.php, change to phpMyAdmin 5.x, change to phpMyAdmin 4.9.4)
After changes, phpmyadmin shows the old version and all buttons on left side (under phpmyadmin logo) are disappeared and the EHCP force panel is no longer displayed correctly.
Do you have a tip for me?
Thank you very much! Now everything works fine on my RPI3b!
Hola a todos, ejecute el comando:
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php
y el resultado fue: “El directorio /usr/share/phpmyadmin/libraries/sql.lib.php” no existe,
estoy en ubuntu 18.04 LTS,
alguna solución,
un millon en gracias.
¿Cuál versión de phpMyAdmin tienes?
Great stuff, thanks!
While it did not necessarily got in the way of using phpMyAdmin, it was rather annoying to see that error every single time.
Thanks for the article. All problems are resolved,
Adamsın
Dankeschön!
Replace it with ((count($analyzed_sql_results[‘select_expr’]) == 1) worked for me.
me too! 🙂
thanks
Thank you for posting the solution, it finally works!
I’m pretty sure there is a typo: an extra parenthesis at the end of the second line.
If not found, try search for if ($options != null && count($options) > 0)
Replace with if (! is_null($options) && count((array)$options) > 0) {
Heh, thanks this has been bugging me for a while, thanks for both fixes.
Thanks a lot!
(How is it possible that a bug like this is still not fixed after months? 🙂 )
thanks a lot
Whats amazing is its nearly 2020 and this issue is still in the official phpmyadmin in the Ubuntu repository. When might it get fixed?
I’ve no idea why they still haven’t updated it. Good for traffic here anyway 😀
The sqllib trick didn’t work, but upgrading phpmyadmin did.