MySQL: Bring over user from other database

Posted on 2013-10-17
Medium Priority
Last Modified: 2013-10-17
I have a production database server with a database "widgetdb"  that I restored onto another database server. I was easily able to do the restoration onto the new server, but now I want to bring over a specific user that was associated with that database.

Now the main problem is that the database (both the other server and the new server), is accessed through a web application and the user needs to be the same in both systems. The user on the previous system is identified using a hash to figure out their password. This keeps me from just recreating the user on the second system.

Is there a script or procedure or something for bringing over a user, whole password and all ?

Question by:johnnypoi
LVL 84

Accepted Solution

Dave Baldwin earned 2000 total points
ID: 39581360
The hash is the password in the user table.  But somewhere in the application or a program that connects to it, the username, password, and access method must be available to be able to make the connection.  You should be able to find the username and password somewhere on the first system and the access method or IP address on the second system can be whatever is needed.
LVL 81

Expert Comment

ID: 39581568
Try copying the hash and setting it as the password for the user.
That should work.

Export the select * from mysql.user where user=user from the old
Then load the result into the new one.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
Media Temple is proud to announce our partnership with the Society of Digital Agencies (SoDA) as their exclusive hosting partner.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question