MySQL users not visible after import

MySQLmysql-5.6percona

I have a Percona MySQL database 5.6 running in a linux machine. I have created new users called test1 and test2. What I did was I imported mysql database from my test setup to this new setup. After which when I run the query

SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user;

I'm not able to see the new users which I created before the import was done but I'm able to connect to MySQL with the users I created before import.

Even after import my new users exist then it has to show in the mysql database right? What is wrong?

Thanks!!

Best Answer

Best is to to : show grants for user@'10.%' ; each user on the original server. Then apply them to the new.

Or you can use pt-show-grants -hhostname -u -p which will list all the grants. You can do that in one line of code:

pt-show-grants -horigalHost -u -p | mysql -hnewHost -u -p