Migrate mysql users to another server

As a general rule, however, do not copy the mysql system schema from one server to another. As a consequence, and as far as I know, there is no “standard” way of copying users and user privileges from one server to another.

If you really want/need to do it, try the following:

$> mysql –silent –skip-column-names -e”show grants for user@host”

The above outputs GRANT statements that you can feed straight away into your target server to create the user and give the same authorisations.

However, if your target server is empty, you could just move the whole data folder from your old server to the new server, and then run the standard upgrade procedure from 5.0 to 5.1 on the new server.

Scroll to top