Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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