Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling drush connections from host #16

Closed
a-fro opened this issue Jan 29, 2015 · 1 comment
Closed

Enabling drush connections from host #16

a-fro opened this issue Jan 29, 2015 · 1 comment

Comments

@a-fro
Copy link

a-fro commented Jan 29, 2015

Hi Jeff,

I'm using a forked and slightly modified drupal-dev-vm that mounts my drupal directory via a shared folder over NFS. Previously, I was using a puppet-based dev environment, which required a setup step to "GRANT ALL PRIVILEGES ON . TO 'root'@'%' WITH GRANT OPTION;". This allowed our developers to configure the database to connect to mysql at the guest IP address (as opposed to 127.0.0.1), which is important for drush. The bind address in both setups appears to be 0.0.0.0. However, I haven't been able to get my host drush to connect to the guest mysql instance with the drupal-dev-vm. Any guidance on what I'm missing? Also, though I can get drush aliases to connect over ssh to the guest, that's not a viable solution in the long run.

@geerlingguy
Copy link
Owner

There are a few different options here...

One, which I prefer, as it leaves things simpler on the configuration side, is to update your drush aliases to connect via SSH properly:

$aliases['local'] = array(
  'root' => '/my-drupal-site', # the root inside your VM
  'remote-host' => 'drupaltest.dev', # the IP or domain of the drupal-dev-vm
  'remote-user' => 'vagrant', # leave this set to vagrant
  'uri' => 'local.mysite.com', # the domain of the site you're controlling with this alias
  'ssh-options' => '-i ~/.vagrant.d/insecure_private_key', # path to the private key for SSH
);

This works for me without issue, and allows all drush commands to work correctly from my control machine.

Another option would be to simply give the root user access to everything on every host, as you did with your earlier puppet-based environment. Just add the following into your config.yml, and the user will be created on provision:

mysql_users:
  - { name: root, host: "%", password: secret, priv: *.*:USAGE }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants