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.
It was helpful, thanks!
WOW!!!!!!!!!!!!!! Master!
Thank you so much! This is really helping!
Thanks!!! work for me
GENIOOOOOOOOOOOOOOOOOOOOOOOOO
Muchisimas Gracias
Thank you very much. Any ETA when the phpMyAdmin will be updated for php7.2+ ?
It’s available but not in the repositories yet. You are better off manually updating phpMyAdmin yourself, it’s not that hard.
Thanks you!!
Thank you, problem solved!
Work for me ! 😀
Works’::
You saved me from a world of pain and horror, thank you! Works on Ubuntu 18.04.1 / PHP 7.2.17 / Apache 2.4.29. I was having trouble with exporting and the second fix did it for me. I applied both just in case.
Thanks It’s work! Ubuntu 18.4, PHP 7.2, Apache/2.4.29, version : 5.7.26 !
you saved my mind from these harmful errors
Thanks it solved the problem completely!
Used… thankyou!
Thanks!
For the import/export issue you can replace the code with:
if (! is_null($options) && count((array)$options) > 0) {
Thanks.
With CTRL+W And CTRL+T and type Linenummer of Error (551) you get directly to the line.
Thanks
Thanks for the helpfull patch. Keep it up !
thanks!!
You saved my day. Thanks for this step-by-step solution.
For import/export issue ,
If you don’t find : (! is_null($options) && count($options) > 0)
search : if ($options != null && count($options) > 0)
Import/Export issues
If you are also getting an error Warning in ./libraries/plugin_interface.lib.php#551 under import and export tabs:
Search:
if ($options != null && count($options) > 0) {
It works for me!
Thanks