Some times we come cross a situation where server-B is missing one user privilege in it and which is available on Server-A. Either preparing an insert from Server-A or restoring mysql.user table from server-A to server-B is a bit risky.
Here is a simple command that captures the required user privileges from a server. Below command takes the backup of missing user privileges into user_priv.sql file
==========
mysqldump --complete-insert --extended-insert=0 -u xxxx -p mysql | grep 'missing user' > user_priv.sql
==========
Here is a simple command that captures the required user privileges from a server. Below command takes the backup of missing user privileges into user_priv.sql file
==========
mysqldump --complete-insert --extended-insert=0 -u xxxx -p mysql | grep 'missing user' > user_priv.sql
==========