I've got Zend Server Community Edition on my Mac.
I need to execute a MySQL query from the terminal command line (not the mysql command line). On ALL of my servers with a traditional LAMP stack (not Zend Server), I can execute queries like this :
$ mysql -u USER_NAME -p PASSWORD -hSERVER_NAME -PTHE_PORT -e "SELECT NOW();"
On ALL of my other servers, I get this response :
+---------------------+
| NOW() |
+---------------------+
| 2012-06-20 18:34:21 |
+---------------------+
$
On my Mac with Zend server, I get:
ERROR 1049 (42000): Unknown database 'NOW();'
If I use any other command such as this one on a non-Zend server, I get a valid response:
mysql -u USER_NAME -p PASSWORD -hSERVER_NAME -PTHE_PORT -e"use stp_downloads; select * from downloads limit 2;"
+--------------+-------------+---------------------+-----------------+
| downloads_id | statuses_id | download_stamp | order_number |
+--------------+-------------+---------------------+-----------------+
| 10001 | 5 | 2011-04-04 22:17:29 | DOWN00000004753 |
| 10002 | 5 | 2011-04-04 22:29:06 | DOWN00000004754 |
+--------------+-------------+---------------------+-----------------+
If I run that command on my Mac with Zend server, I get :
/usr/local/zend/mysql/bin/mysql.client Ver 14.14 Distrib 5.1.54, for apple-darwin9.8.0 (i386) using readline 5.1
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Usage: /usr/local/zend/mysql/bin/mysql.client [OPTIONS] [database]
Followed by all the usage info.
Why can't MySQL on Zend Server properly process SQL statements using -e or --execute??
What am I doing wrong??
Thanks,
Justin

