Hello Michael.

I thought I'd share this code for people who might want to use Quickstart with longer domain names.

The following addresses the limitation on char length in the DB name or username.

//md5 the domain name to get a unique domain id
$db_domain = md5($options['domain']);
//trim it down, trusting the md5 remains unique enough in its first 13 chars
$db_domain = substr($db_domain, 0, 12);
//add a qs (QuickStart) to the front of the string so it does not potentially start with an integer
$db_domain = 'qs'.$db_domain;
//then set $defaults['domain_']
$defaults['domain_'] = $domain_ = $db_domain;

To use this, one would have to "hack" the quickstart_params function by commenting out:

  if (strlen($options['domain']) > 15) {
    $ret['fail'] = true;
    drush_log("  '--domain' must be less than 16 characters long, for mysql user name to work.", 'error');
  }

All the best.
--Sean

Comments

MichaelCole’s picture

Status: Needs review » Closed (works as designed)

Hi Sean,

Thanks for this. I think having the db-name as a hash would make phpmyadmin hard to use. "Wait, which database am I working with?"

Cool that you found something that works for you though.

BTW, you can edit the dns and apache entries like you would any LAMP app. Just go to the ~/websites/config folder.

Cheers,

Mike

MichaelCole’s picture

Title: Big domain hack » Expand "domain" parameter to 64 characters
Status: Closed (works as designed) » Active

This is possible because db names can be 64 characters in MySQL 5.x

db users must be 16 chars, but it's not a problem to use the same db user, as long as I don't delete them.

Investigate :-)

caschbre’s picture

I would also be interested in allowing the domain to be more than 16 characters. Is there a way to parameterize this so that the myqsqlusername is provided as another parameter (and required) to allow a domain to be more than 16 characters?

I realize we can manually adjust the dns and apache entries but one of the advantages of quickstart are the scripts that handle that for you.

MichaelCole’s picture

Component: Miscellaneous » Drush
ed@edburton.net’s picture

Sorry to ask a newb question, could somebody explain in more details how I implement the aforementioned "The following addresses the limitation on char length in the DB name or username..." and "To use this, one would have to "hack" the quickstart_params function by commenting out:...". Hopefully this might be as easy as telling me the path to two files to edit?

Chris Charlton’s picture

Noting the request in here is a duplicate of http://drupal.org/node/1007882.

KLicheR’s picture

I've made a similar patch here: http://drupal.org/node/1007882#comment-5867096

It use a hash only if the domain name is longer than 8 characters and if it is, the 8 firsts characters are preserved so it's usable in phpMyAdmin.