I have a MySQL database with some users and several DBs each one starting with username_ (guess who can access them...).

Since I'm migrating some websites from a host to another, mantaining the same directory structure and DB hostname as configured in webapps, I want to migrate both all the DBs belonging to a single user and the GRANT associated to that user, since I don't know the password of him.

I've found how to move the data (just add an scp command and voilà), but do you know how to migrate a user and keep its password too?

By the way, I'm manually moving only one user at a time, so no need to automate for everyone. Short downtime is acceptable.


The user database in the special database named: mysql, if you migrate it then the users will be migrated.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.