Working on a production site that's normally been managed with the web interface, but I'd like to begin using drush (for a number of things). I'm running win 7 and WAMP, and I've mapped the remote network drive with the drupal install as Z: (it's on the intranet).
Attempting to run drush to do various management tasks, but my access to the DB is always denied (for root). Settings.php shows login credentials to the DB that apparently do not work with drush. I have Mysql login username and pwd that work with phpMyAdmin and other Mysql tools on the drupal database in question. Running "drush status" shows that drush is connecting with the credentials listed in settings.php even though I have set up an alias file with my credentials.
I have tried running cmd.exe as admin and then using "net share" to reconnect the mapped drive where the drupal install exists. No joy.
Here is the alias I've set up in drush (at least the important part):

$aliases['library'] = array(
    'uri' => 'library_prod',
    'root' => '//dv-my/library/',
    'db-url' => 'mysql://username:pw$d@dv-my.shfd.edu:3306/drupal_library',

And here is the settings.php that I cannot seem to override, regardless of the herculean effort I choose to put into the attempt:

$db_url = 'mysql://foo:bar@localhost/drupal_library';
$db_prefix = array();

I do not have access to change the credentials listed in settings.php (although I have definitely tried). I have tried changing config.php.inc to hold my Mysql information, adding aliases to the sites folder, holding my tongue on the left side rather than the right...and nothing seems to work. What am I forgetting that I shouldn't be? Does drush need some particular permissions on the remote site that I don't have? Is there some particular configuration of the alias file that I'm not using?
I would love to use drush as I use it on my home site with great pleasure, but I'm nearing my wits end.

Comments

froboy’s picture

I'm having this same problem, but on a Mac running drush locally trying to access a remote server...

Let me explain:

Our Drupal instances are hosted on an institutional server where we don't have ssh access, but we do have sftp access and I've been granted permission to access the db's (for instance, through Sequel Pro). I've mounted the remote files locally via Transmit's "Mount as Disk" functionality and I can access them at /Volumes/path.to.server/drupal/sites/whatever. I have drush 4.4 installed locally at /Applications/MAMP/drush and it's working fine for local sites and even to download modules on the remote file system, but I have not been able to bootstrap the remote system to do any complex commands.

I've created aliases.drushrc.php in my drush directory and I've confirmed that it's working. In the file, I have the following:

$aliases['mysite'] = array(
    'uri' => 'http://mysite.myschool.edu',
    'root' => '/Volumes/mysite.myschool.edu/drupal',
    'db-url' => 'mysql://user:pass@myserver.myschool.edu:3306/my_db',
    'db-prefix' => 'mysite_',
    'remote-port' => '3306',
  );

but no matter what I do, when I run "drush @mysite" it uses the db connection info from settings.php and completely ignores the db-url line in my aliases file. When I run "drush site-alias @mysite" I get the following:

$aliases['mysite'] = array (
  'uri' => 'http://mysite.myschool.edu',
  'root' => '/Volumes/mysite.myschool.edu/drupal',
  'db-prefix' => 'mysite_',
  'remote-port' => '3306',
);

I've also tried using an array in my settings.php to define $db_url['default'] and $db_url['remote'] but I can't figure out how to access these aliases via drush.

Any help would be greatly appreciated.

Mark_L6n’s picture

I had the same problem, which had to be solved with help from the webhosting company. Even with SSH access working for copying files over, there still were more permissions that had to be set up for accessing the DB.
You can also try adding


  'path-aliases' => array(
    '%drush-script' => 'php /pathTo/drush/drush.php',
  )