# How to expert MySQL user account, with password and right permission to another MySQL server

**URL:** <https://forums.percona.com/t/how-to-expert-mysql-user-account-with-password-and-right-permission-to-another-mysql-server/7873>\
**Category:** Database Monitoring and Management\
**Tags:** community, mysql, percona\
**Created:** [August 10, 2020, 2:21am UTC](https://forums.percona.com/t/how-to-expert-mysql-user-account-with-password-and-right-permission-to-another-mysql-server/7873 "2020-08-10T02:21:21Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![DBA100](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@DBA100](https://forums.percona.com/u/DBA100)\
**Post date:** [August 21, 2020, 1:26am UTC](https://forums.percona.com/t/how-to-expert-mysql-user-account-with-password-and-right-permission-to-another-mysql-server/7873/7 "2020-08-21T01:26:22Z")

</div>

[I](https://serverfault.com/questions/8860/how-can-i-export-the-privileges-from-mysql-and-then-import-to-a-new-server/399875#399875)&nbsp;also see from the same link, both of them works perfectly?

METHOD #1

You can use&nbsp;[**pt-show-grants**](http://www.percona.com/doc/percona-toolkit/2.0/pt-show-grants.html)&nbsp;from Percona Toolkit

```auto
MYSQL_CONN="-uroot -ppassword"
pt-show-grants ${MYSQL_CONN} &gt; MySQLUserGrants.sql

```

METHOD #2

You can emulate&nbsp;pt-show-grants&nbsp;with the following

``` MYSQL_CONN="-uroot -ppassword" mysql ${MYSQL_CONN} --skip-column-names -A -e"SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user WHERE user\<\>''" | mysql ${MYSQL_CONN} --skip-column-names -A | sed 's/$/;/g' \> MySQLUserGrants.sql ```

---

_[View the full topic](https://forums.percona.com/t/how-to-expert-mysql-user-account-with-password-and-right-permission-to-another-mysql-server/7873)._
