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.
Thank you. Thank was really annoying.
muchas gracias
De nada.
awesome ๐
Thanks !
Worked like a charm. Thank you!
Just adding my thank to the pile ๐
thanks a lot , your solution works well ๐
Merci beaucoup. It help me a lot.
Really thak you!!
Thank you very much. It help me a lot.
thank you brother!!!
๐๐
it help me a lot but after this solution i am facing count () function is not working with group by . hosting to Digital Ocean Droplet where
OS is Ubuntu 18.04,
Apache2,
PHP 7.2,
Tomcat 9,
MySQL 5.7 ,
PhpMyAdmin 4.8.
but same program is working in another hosting (not VPS) which is running.
will you give me guideline ?
If you are getting more errors, I would suggest upgrading to the latest version of phpMyAdmin
See: How to Manually Upgrade phpMyAdmin
it help me a lot.
great
๐
Thanks.
๐
Thanks! It works perfectly.
Cool ๐
Thx ! It works ๐
๐
Thanks it does the work.
Great!
perfect
๐
I seem to have errors in phpmyadmin. I get Warning in ./libraries/plugin_interface.lib.php#551 under import and export tabs. I have done above ๐
Backup
plugin_interface.lib.php
Edit
plugin_interface.lib.php
Press
CTRL
+W
and search forReplace with
Save file and exit. (Press
CTRL
+X
, pressY
and then pressENTER
)I ended up taking a complete back flip. I worked out what i did wrong. I set up the database users incorrectly and wouldn’t connect. I ended up using a raspberry pi instead of laptop. Easier to make backups or repair if it goes down. I have found your posts very handy. thanks
๐
if not found:
if (! is_null($options) && count($options) > 0) {
please search:
if ($options != null && count($options) > 0) {
and … It works.Hi, thanks for the article and this comment. When I tried this, the section of the screen is blank. There is nothing in the section that has the import options.
please try
if ($options != null) {
worked for me…thanks!
Cool ๐
<3 worked for me <3
thanks!!! worked for me…
thanks
Carefull for some of us does changing this setting isn’t working, You get Blank Page, follow the steps @Ardhia Mangku Ikhsan Provided.
Thanks for the tip.
Thanks!
Works, you rescued me.
This worked on Ubuntu MacBook Pro. Thanks!
Saved my day too: tnx.
๐
saved my day. thanks!
๐
๐ worked like a charm 18.04 7.2 cheers
Super ๐
Perfect
๐
Hi, solution in sql.lib.php is perfect. Thanks.
Great! Hopefully the repositories will update with the latest version of phpMyAdmin soon.
Error in processing request
Error code: 500
Error text: Internal Server Error
1, I get this error when selecting a table and query in Phpmyadmin.
2, Also My imported files are not in the db.
3, Export page in the created DB is blank.
Kindly help me to solve this issue.
Thank you in advance. Have a great day
Regards,
Sampath
try this, its work with to me:
sed -i “s/|\s*((count(\$analyzed_sql_results[’select_expr’])/| (\1)/g” /usr/share/phpmyadmin/libraries/sql.lib.php
Got from https://stackoverflow.com/questions/48001569/phpmyadmin-count-parameter-must-be-an-array-or-an-object-that-implements-co
sudo sed -i “s/|s*((count($analyzed_sql_results[‘select_expr’])/| (1)/g” /usr/share/phpmyadmin/libraries/sql.lib.php