missing something obvious w/grant statement length?

2003-12-16 Thread Ari Davidow
I seem to have run into a problem with a host name that incorporates a hyphen:

mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED BY foo;
ERROR 1064: You have an error in your SQL syntax near 
'-dev.foo.com  IDENTIFIED BY foo' at line 1
mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED BY foo;
ERROR 1145: The host or user argument to GRANT is too long

I must be missing something very obvious--how to incorporate a hostname 
with a hyphen, for instance. Can someone help?

ari

Ari Davidow
[EMAIL PROTECTED]
http://www.ivritype.com/
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: missing something obvious w/grant statement length?

2003-12-16 Thread Paul DuBois
At 13:12 -0500 12/16/03, Ari Davidow wrote:
I seem to have run into a problem with a host name that incorporates a hyphen:

mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED BY foo;
ERROR 1064: You have an error in your SQL syntax near '-dev.foo.com 
IDENTIFIED BY foo' at line 1
mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED BY foo;
ERROR 1145: The host or user argument to GRANT is too long

I must be missing something very obvious--how to incorporate a 
hostname with a hyphen, for instance. Can someone help?
Quote it.  Better yet, always quote usernames *and* hostnames to avoid
the problem entirely: 'me'@'mysite-dev.foo.com'
Note that the username and hostname are quoted separately.

--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: missing something obvious w/grant statement length?

2003-12-16 Thread Mike Johnson
From: Ari Davidow [mailto:[EMAIL PROTECTED]

 I seem to have run into a problem with a host name that 
 incorporates a hyphen:
 
 mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED BY foo;
 ERROR 1064: You have an error in your SQL syntax near 
 '-dev.foo.com  IDENTIFIED BY foo' at line 1
 mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED 
 BY foo;
 ERROR 1145: The host or user argument to GRANT is too long
 
 I must be missing something very obvious--how to incorporate 
 a hostname with a hyphen, for instance. Can someone help?


The syntax is a bit weird for GRANT statements; either side of [EMAIL PROTECTED] are 
two separate args to be stored in two separate columns.

This should work...

GRANT ALL ON *.* TO 'me'@'mysite-dev.foo.com' IDENTIFIED BY 'foo';


-- 
Mike Johnson
Web Developer/Systems Asst.
Smarter Living, Inc.
phone (617) 497-2500 x226

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: missing something obvious w/grant statement length?

2003-12-16 Thread Paul DuBois
At 13:29 -0500 12/16/03, Mike Johnson wrote:
From: Ari Davidow [mailto:[EMAIL PROTECTED]

 I seem to have run into a problem with a host name that
 incorporates a hyphen:
 mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED BY foo;
 ERROR 1064: You have an error in your SQL syntax near
 '-dev.foo.com  IDENTIFIED BY foo' at line 1
 mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED
 BY foo;
 ERROR 1145: The host or user argument to GRANT is too long
 I must be missing something very obvious--how to incorporate
 a hostname with a hyphen, for instance. Can someone help?


The syntax is a bit weird for GRANT statements; either side of 
[EMAIL PROTECTED] are two separate args to be stored in two separate columns.
Why is it weird?  What if you wanted to include a '@' character in
your username? '[EMAIL PROTECTED]'-style quoting wouldn't allow that. :-)

This should work...

GRANT ALL ON *.* TO 'me'@'mysite-dev.foo.com' IDENTIFIED BY 'foo';

--
Mike Johnson
Web Developer/Systems Asst.
Smarter Living, Inc.
phone (617) 497-2500 x226


--
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
Are you MySQL certified?  http://www.mysql.com/certification/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: missing something obvious w/grant statement length?

2003-12-16 Thread Mike Johnson
From: Paul DuBois [mailto:[EMAIL PROTECTED]

 At 13:29 -0500 12/16/03, Mike Johnson wrote:
 From: Ari Davidow [mailto:[EMAIL PROTECTED]
 
   I seem to have run into a problem with a host name that
   incorporates a hyphen:
 
   mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] 
 IDENTIFIED BY foo;
   ERROR 1064: You have an error in your SQL syntax near
   '-dev.foo.com  IDENTIFIED BY foo' at line 1
   mysql GRANT ALL ON *.* TO [EMAIL PROTECTED] IDENTIFIED
   BY foo;
   ERROR 1145: The host or user argument to GRANT is too long
 
   I must be missing something very obvious--how to incorporate
   a hostname with a hyphen, for instance. Can someone help?
 
 
 The syntax is a bit weird for GRANT statements; either side of 
 [EMAIL PROTECTED] are two separate args to be stored in two separate columns.
 
 Why is it weird?  What if you wanted to include a '@' character in
 your username? '[EMAIL PROTECTED]'-style quoting wouldn't 
 allow that. :-)


Heh, OK, weird has bad connotations. What I meant was that the syntax for a GRANT 
statement replaces a series of INSERT/UPDATE statements on the mysql db, and as such, 
while succinct, it's not always entirely intuitive.

Another example of that is the IDENTIFIED BY 'password' clause. It took me a few times 
to remember that it automatically called PASSWORD() on 'password' -- then again, I 
came into GRANT statements from first doing the INSERT/UPDATE calls manually.   :)


-- 
Mike Johnson
Web Developer/Systems Asst.
Smarter Living, Inc.
phone (617) 497-2500 x226

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]