MySQL Forums
Forum List  »  Data Recovery

Restore dump - missing privileges on new server
Posted by: Marc Wenger
Date: October 02, 2017 05:15AM

Hello, I'm using a procedure to restore the production DBMS to a Test DBMS once a week on a different machine.
My problem is that the data and DBs are restored correctly but I miss the priviledges on the db.

to Backup my database I use this procedure:

mysqldump -u root -p --all-databases --flush-logs > mysql-AllDB-dump.sql

here is the point. when I look into the mysql-AllDB-dump.sql I see all users configured into the "INSERT INTO user VALUES" command but when I restore it only the root user has permissions.

here the restore command:
mysql -u root -p < mysql-AllDB-dump.sql

when I run this command on the source server (Prod)
SHOW GRANTS FOR 'wmnet'@'localhost';

I get the right result:

+----------------------------------------------------------+
| Grants for wmnet@localhost |
+----------------------------------------------------------+
| GRANT USAGE ON *.* TO 'wmnet'@'localhost' |
| GRANT ALL PRIVILEGES ON `wmnet`.* TO 'wmnet'@'localhost' |
+----------------------------------------------------------+
2 rows in set (0.00 sec)

but when i run the same command i get the error:
ERROR 1141 (42000): There is no such grant defined for user 'wmnet' on host 'localhost'

What am I missing to restore the right privileges?

Thanks for help

Options: ReplyQuote


Subject
Views
Written By
Posted
Restore dump - missing privileges on new server
3528
October 02, 2017 05:15AM


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.