Mysqli prepare error: Unknown column 'login' in 'where clause'

I attempted logging into my matomo today and I got this error: “Mysqli prepare error: Unknown column ‘login’ in ‘where clause’”. Does anyone have any pointer to the cause and fix? Thank you.

Matomo version is: 4.6.1 and I’ve never had this issue before.

Hi @Abbey_O !
I think the Matomo database has been corrupted in your case. But I hope, if you update your Matomo instance to the latest version i.e. 4.8.0 then it will be recovered. So, my suggestion is to update Matomo.

Hi @Naser_Aslam, thanks for responding to my message. The issue is that we are able to run queries against the database. The only thing affected (so far, I think) is the login. Could it be the login part of the db that is corrupted?

Link to previous similar question:

I encounter also a similar issue on our test instance, but on segment creation:
Mysqli prepare error: Unknown column ‘hash’ in ‘field list’
The issue appeared suddenly, and does not appear on our production instance (same version: 4.3.1)

Maybe it is related to MySQL itself?
@innocraft any idea?

Just an update on this issue… I downloaded the latest version of Matomo, and got the same error. I also noticed that, even if I entered wrong (non-existent) username and password, I still got the same error. So, I am not sure if this whole thing is hitting the database. Because, it doesn’t matter what I entered as username, I still got the same error.

Did you also change the database for newly downloaded Matomo? Or using old (affected) database for newly downloaded Matomo?

Thanks everyone for your help. I was able to fix this issue yesterday by running the core update command (sudo php /var/www/html/matomodir/console core:update). @Naser_Aslam I believe there were some database changes that the update fixed. Thank you.

2 Likes

OK, I have to try to update…One day! (I have currently no time! :’( )