This function works on 5.0.75 on Ubuntu, but not on 5.1.44 on OSX (Lion):

mysql --database=sps --host=localhost --user=root --password=somepass -e "SELECT 1;"

The expected output is this:

+---+
| 1 |
+---+
| 1 | 
+---+

On OSX, though, it just dumps me to a mysql prompt awaiting a command, without ever executing the command specified by the -e switch.

Any idea why it doesn't execute and exit back to the command line as it should? The net affect of this is that I am unable to use site-install on my local machine.

Comments

greg.1.anderson’s picture

Category: bug » support

I don't think anyone is going to support mysql issues here; I'll leave this open for a bit in case, but you'd probably do better in a different forum. (I don't use a Mac myself, but as several other maintainers do, it is my understanding that Drush works well on MacOS.)

seanr’s picture

I totally get that, but meant it as a suggestion that maybe we should have an alternate way of detecting the existence of the specified database (should have said that in my initial post). If the current method doesn't work in at least one common setup, maybe there's a better way. Regardless, I also posted the underlying issue to StackExchange, though I haven't gotten any answers yet.

seanr’s picture

BTW, the rest of Drush works well, only site-install flops.

greg.1.anderson’s picture

Do sql-query and sql-sync work?

seanr’s picture

sql-query works, but I don't currently have a usable test case for sql-sync (I'd need to set up multiple DBs, aliases, etc.). I'll try to do that later.

greg.1.anderson’s picture

sql-query looks just like #0, except that it reads the SQL from a temp file rather than using the -e option. Perhaps you could try altering site-install to use some of the functions from sql.command.inc, so that it behaves the same way. Patches welcome.

greg.1.anderson’s picture

Version: 7.x-5.8 » 8.x-6.x-dev
Status: Active » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If you still need help, please ask your question again on Drupal Answers and then post a link here to the new question. Please also change the status of this issue to closed (duplicate).

Use our Github project for contributing code, or reporting bugs, or requesting features.