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.
Thanx! That did the trick.
Amazing… <3
Excelent, resolved straight away!
Obrigado , Muito bom, parabéns!
Nice!
Solved! Great, thanks
you solved it!! Thank you!
Ça fonctionne très bien Merci!
+1 worked great for me. Thanks!
Terima Kasih Banyak.
Sama-sama.
Work like a charm. Thank you.
ok
Thank You So Much DevAnswers…
The one line of code solve the issue….
Great!!!
nice bro! I use vestaCP but having problem with the phpmyadmin.
Work! Update today! 01/12/18.
2019 !
Thank you!
Thank you ! Very useful 🙂
I am facing the import and export error ..
Do you help me correct?
See this comment.
Very nice. Did it via FileZilla. Only download file, edit and upload. Or even edit it via nano and save. Reload the page in phpmyadmin and the error isnt there anymore. Thank you very much 😀
Thank you. Works!
Please can do phpmyadmin error on php7.3
thanks
Please I have error with phpmyadmin using php7.3
if you can do the correction for us. thank you
this is work on my Ubuntu 18.04 Budgie version.. Thanks a lot
it’s working thank you
Thanks!