Bug #46987 MySQL Client on Mac - execute option not working
Submitted: 29 Aug 2009 0:14 Modified: 31 Aug 2009 16:08
Reporter: Nicholas Calugar Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.1.32 OS:MacOS (Mac OS X v10.5.8)
Assigned to: CPU Architecture:Any
Tags: client, execute, mac

[29 Aug 2009 0:14] Nicholas Calugar
Description:
I'm trying to use -e option to run 'show databases;' but it thinks I am trying to use a database called "databases;". Details in private comment.

How to repeat:
On a Mac:

mysql -e 'show databases;'
[29 Aug 2009 6:19] MySQL Verification Team
On Windows Vista:

c:\dbs>5.4\bin\mysql -uroot --port=3540 -e 'show databases;'
ERROR 1049 (42000): Unknown database 'databases;''

c:\dbs>5.4\bin\mysql -uroot --port=3540 -e "show databases;"
+--------------------+
| Database           |
+--------------------+
| information_schema |
| ese                |
| estar              |
| h                  |
| mysql              |
| systest            |
| test               |
+--------------------+
[29 Aug 2009 6:48] Nicholas Calugar
Thanks for the reply Miguel,

I tried double quotes and got the same error.
[29 Aug 2009 6:49] Valeriy Kravchuk
Sorry, but I can not repeat this on my Mac with latest 5.1.39. Look:

77-52-7-86:5.1 openxs$ uname -a
Darwin 77-52-242-77.dialup.umc.net.ua 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386
77-52-7-86:5.1 openxs$ bin/mysql -uroot test -e 'show databases;'
+--------------------+
| Database           |
+--------------------+
| information_schema |
| XY                 |
| application        |
| django             |
| elsewhere          |
| mydb               |
| mysql              |
| one                |
| site               |
| test               |
| test2              |
| test-16            |
| user               |
+--------------------+
77-52-7-86:5.1 openxs$ bin/mysql --version
bin/mysql  Ver 14.14 Distrib 5.1.39, for apple-darwin9.6.0 (i386) using readline 5.1
[31 Aug 2009 16:08] Nicholas Calugar
Valeriy,

Thanks for the reply...I will try to upgrade my MySQL to the latest. I am using the version that came with Zend Server CE stack, so hopefully I can upgrade it separately.

FYI:

c23117mac:~ calugarn$ uname -a
Darwin c23117mac.mascorp.com 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
c23117mac:~ calugarn$ mysql --version
/usr/local/zend/mysql/bin/mysql.client  Ver 14.14 Distrib 5.1.32, for apple-darwin9.5.0 (i386) using readline 5.1