When you are running the automatic install through drush hostmaster-install to setup the hostmaster environment, the script should assume that the default mysql username used to create other users and databases is root, it should prompt to ask which username it is because if you want to change it you have to hack the install.hostmaster.inc file.

Before prompting for MySQL privileged user ("!root") password, it should happen there.

Comments

Anonymous’s picture

You should be able to pass your own mysql user as an argument to drush hostmaster-install, with --aegir_db_user

Per install.hostmaster.inc, 'root' is only the default to fall back on if no other value is provided by the user:

drush_set_default('aegir_db_user', 'root');
$aegir_db_user = drush_get_option('aegir_db_user');
...
drush_set_option('aegir_db_pass', drush_prompt(dt('MySQL privileged user ("!root") password', array('!root' => $aegir_db_user))));
Anonymous’s picture

Category: task » support
Status: Active » Closed (won't fix)

Since we are making use of drush options, allowing the user to override this cleanly themselves, I think this is a reasonable design (and it allows us to automate installs still), so I'm marking this as won't fix. Let me know if the --aegir_db_user='foo' switch doesn't work, however.

marafa’s picture

it doesnt work

cli used: /var/www/html/aegir/bin/drush/drush hostmaster-install --aegir_db_user=root --aegir_db_password=password

as you can see it ignores root and still attempts to use aegir

The following settings will be used:
Aegir frontend URL: localhost.localdomain
Master server FQDN: F.Q.D.N
Aegir root: /var/www/html/aegir
Aegir user: aegir
Web group: apache
Web server: apache
Aegir DB host: localhost
Aegir DB user: root
Aegir DB password:
Drush make version: 6.x-2.2
Aegir version: 6.x-1.1
Aegir platform path: /var/www/html/aegir/hostmaster-6.x-1.1
Aegir makefile: /var/www/html/aegir/.drush/provision/aegir.make
Admin email: root@localhost.localdomain

Do you really want to proceed with the install (y/n): y
SQLSTATE[28000] [1045] Access denied for user 'aegir'@'localhost' (using password: NO) [error]
Unable to connect to database server.

Anonymous’s picture

You want --aegir_db_pass (not aegir_db_password)

Edit: I don't know why it says aegir@localhost, but the default, even if it was ignoring your override, would in fact be root@localhost. Something else seems to be going wrong there.. you are better off filing a new support request and detail your OS, php version, aegir version etc. Also, although I don't think it is the specific cause, you appear to have deviated from the install instructions by putting stuff in /var/www/html - which makes me wonder what other 'differences' there might be that could explain this issue..

marafa’s picture

oh and it ignores the password given too

Anonymous’s picture

See #4 ...