Wordpress Workspace gives MySQL Connect Error if C9 username is longer than 16 chars




I started usign Cloud9 since few days and I love you product, but I found a little bug (that has taken me hours to figure out). When you have a long C9 username (more than 16 chars) the line @ wp-config.php in WordPress:

define('DB_USER', getenv('C9_USER'));

has to be changed to:

define('DB_USER', substr(getenv('C9_USER'), 0, 16));

because MySQL has a default username char limit of 16 and the long C9 username will be truncated. This leds to a “Error establishing connection to database” in the default installation of Wordpress Workspace.

Maybe you will update the WP Workspace template to fix this issue.


Thanks for the PR on that. I’ve merged it, and it’ll go out when we update the wordpress image next.