- Word of the day: Ouch.
- I’m done with the cancer, but the cancer isn’t done with me
- Goodbye, my dopey dog.
- So long, Alex King
Polluting the internet since 2004
December 18, 2009 | Web Design & Development
Stupid Gippy Trick #2495: The title may sound funny, and the concept a bit weird, but when you’re working on many different client servers, development and production servers, with as many different configurations, keeping track of DB credentials can get a little tiresome and time consuming.
Here’s a command line one liner to print the database credentials so that they’re easily used to manually log in to MySQL or do a database dump:
Which prints out:
Voila! No more switching back and forth from a credentials file or database or get the credentials, you simply use that’s already there.
Somebody more ambitious could probably make a little function that parses that output and creates a MySQL login command or mysqldump command, but right now that’s not me. 😉