Join 3,413 readers in helping fund MetaFilter (Hide)

Tags:

Exporting Mysql user data
April 11, 2011 10:49 AM   Subscribe

Mysqlfilter: How can i export all users ids, passwords, and permissions (grants), from mysql?
posted by flipmiester99 to Computers & Internet (3 answers total)
 
The manpage for mysqldump is a good source for the information you seek.
posted by schade at 10:56 AM on April 11, 2011


Everything is in the database named "mysql" (e.g. the user records are in mysql.users). Depending on how complex your user access rules are, so the permissions will be spread over different other tables. Do a mysqldump on that and look over the results.
posted by devbrain at 11:45 AM on April 11, 2011


Just noting you can't actually export the passwords, at least not in most installations. mysql passwords are encrypted, so all you can export is the hash of the passwords. This is a feature.

Although everything is in the mysql db and largely in the user table, that's not the right way to go about this. The easiest way appears to involve a small shell script. This is the best discussion I could find of it:
http://serverfault.com/questions/8860/how-can-i-export-the-privileges-from-mysql-and-then-import-to-a-new-server

(just ignore the parts about importing into another server).
posted by contrarian at 4:25 PM on April 11, 2011


« Older Where can I/should I stay over...   |  How do I prioritize all the ta... Newer »
This thread is closed to new comments.