I’ve seen this before a while back. The guy wound up having to update his MySQL and then grant all permissions to root before he did the restore. It had something to do with the idea that the script can’t grant permissions to a user that doesn’t exist or something like that.
I’ll look around for it. It was a couple years ago I think I remembered seeing it.
I am quite sure it has something to do with the increased security model of mysql 8.x/mariadb as restore is working in ubuntu 18.04 without problems. @Ilia ?
I will have to give it another try. I have saved this issue and I will test and fix it before new Virtualmin release (now is time for working on the theme).
when restoring a backup on ubuntu 20.04 with
If you do the restore from UI do you get the same error or it only happens when restoring from the CLI?
I only tried with the transfer server option (not backup and restore) which doesn’t give any errors.
backup was created on ubuntu 18.04, mysql 5.7.33-0ubuntu0.18.04.1-log , virtualmin 6.14
force restarting mysql didn’t change anything…
Made a bit of progress on this issue. Steps to reproduce:
Backup a domain
Restore to MySQL 8 server
Error reported:
Restore failed : SQL grant all on hepple\_db.* to ‘hepple_user’@‘localhost’ with grant option failed : You are not allowed to create a user with GRANT
Log into MySQL as root AND localhost (it should default to that)
Do
SHOW GRANTS FOR ‘root’@‘localhost’;
The resultant permissions that are spit out are huge but the bottom line is they don’t contain the GRANT ALL permission.
In other words, if SHOW GRANTS has to be specific about which permissions exist, instead of this line:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
It means root doesn’t actually have full permissions.
On one system, I was able to get it working by using -h127.0.0.1 and that root user had full permission. On the current system I’m working on I don’t have the same luck so can’t get past this problem.
Here are some guys on Stack battling with something similar and where I learnt about the GRANTs available Their remedy of upgrade server won’t work for me.