Using Yiic for plugin migration I've been trying to follow the docs for creating a plugin migration (https://craftcms.com/docs/plugins/migrations) but any attempts to run yiic seem to die with:

CDbConnection failed to open the DB connection.


My Google-fu has not come up with any relevant answers. This is with Craft setup in a Vagrant box, if that makes a difference.
If you're using 'localhost' for the 'server' in craft/config/db.php, try '127.0.0.1' and visa-versa.

For some reason, some environments are picky about that when connecting to MySQL from the CLI.