The target table user of the INSERT is not insertable-into

So I did the most wonderful thing of accidentally deleting all root user in mysql. Long story and I’m pretty upset about it.

Anyways before huge panic I just looked up a way to re-create root and found this

So I went to do this and now found this error I believe is from virtualmin new version?

The target table user of the INSERT is not insertable-into

I have tried several of the fixes I found in virtualmin forums from this thread and none of them worked.

https://virtualmin.com/node/66724

I got as far as trying this command
perl -MCPAN -e shell cpan> install Digest::SHA1 and it just stays there and nothing happens.

Now I’m starting to panic. Everything works for now as all domains have their own user virtualmin creates so that is fine, but I cannot create anything new, cannot access DB as super user.

I read that Jamie was working on a fix for at least error
The target table user of the INSERT is not insertable-into
from this thread *[QUICKFIX]* for MariaDB 10.2 - 10.4.7 !!! mentioned by @Eric

Does anyone know if that release is out?

Can I escape this error by downgrading virtualmin? if so what version should I fetch?

Anyone have any advice?

Centos7
Webmin version 1.940
Usermin version|1.780
Virtualmin version 6.08
mysql Ver 15.1 Distrib 10.4.11-MariaDB, for Linux (x86_64) using readline 5.1

You’re using the syntax that causes that error! Webmin/Virtualmin have nothing to do with it when you’re in the mysql CLI.

As far as I know, Virtualmin now uses the new syntax.

Thanks for the reply @Joe

I finally found my solution.

This is a big thanks to @RolandoMySQLDBA on this thread here

The only problem I had with his answer was that in the /var/lib/mysql/InitFile.sql file the missing WITH GRANT OPTION;

example:

GRANT ALL PRIVILEGES ON *.* TO root@localhost
IDENTIFIED BY 'Gstlouis78' WITH GRANT OPTION;

Do not forget to remove the file when you are done, update to remove the init-file string you added the /etc/my.cnf

I am still not sure why mariadb was giving me the error “INSERT is not insertable-into”
and I cold not find any documentation that explains this was a mariaDB problem. If anyone has more information about this please share