Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.