I am using 000webhost.com and I am using phpMyAdmin there. I am getting this error from MySQL when I run my PHP script as the title says:
Column count of
I was using a windows 10 system and the solution that worked for me was mysql_upgrade -u root -p
But you need to ensure that the path to the mysql_upgrade script which is present in the mysql/bin folder of your installation directory needs to be added in the environment variable path for this command to work
Although you may be correct about the necessity for upgrade, that's not the only reason this error occurs.
When the following is called with a query that returns 1 row
my $rv = $sth_indexq->fetchall_arrayref;
the following error is reported:
DBD::mysql::st execute failed: Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50520, now running 50528. Please use mysql_upgrade to fix this error. at
...
However, the real cause of the error was use of fetchall_arrayref instead of fetchrow_arrayref. The following worked without errors:
my $rv = $sth_indexq->fetchrow_arrayref;
The data in $rv was only 1 level deep, not 2.
The mysql_upgrade solution may very well solve this issue, but the simple solution is know your data and use the right retrieval code.
J.White