dbTalk Databases Forums  

Syntax error .. but why?

comp.databases.mysql comp.databases.mysql


Discuss Syntax error .. but why? in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SpreadTooThin
 
Posts: n/a

Default Syntax error .. but why? - 01-12-2011 , 09:14 PM






GRANT ALL PRIVILEGES ON *.* TO me @'host.domain' IDENTIFIED BY
'mypassword';

Is giving me a syntax error..
I'm on mac os x 10.6
I wonder if this has something to do with how I started mysql?
sudo /usr/local/mysql/bin/mysql

Can the password be the same for the same user logging in from a
different workstation?
Is the space necessary before the @? are the 's necessary around
host.domain if it's not an IP address?
Are 's necessary around the password....
I've tried everything and i just can't get it to work.

Reply With Quote
  #2  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: Syntax error .. but why? - 01-13-2011 , 02:48 AM






El 13/01/2011 4:14, SpreadTooThin escribió/wrote:
Quote:
GRANT ALL PRIVILEGES ON *.* TO me @'host.domain' IDENTIFIED BY
'mypassword';

Is giving me a syntax error..
Not this query. If the real query you are using is triggering a syntax
error, it's because you have a password like "o'brian" and you aren't
escaping it properly.


Quote:
I'm on mac os x 10.6
I wonder if this has something to do with how I started mysql?
sudo /usr/local/mysql/bin/mysql
It's a fascinating hypothesis but, as far as I know, the SQL syntax
supported by MySQL is the same for all system users.


Quote:
Can the password be the same for the same user logging in from a
different workstation?
Why couldn't you repeat passwords? It wouldn't be a safe system if you a
message like "password abcdef is already in use by another user"...

Quote:
Is the space necessary before the @? are the 's necessary around
host.domain if it's not an IP address?
Are 's necessary around the password....
I've tried everything and i just can't get it to work.
You don't have to guess:

http://dev.mysql.com/doc/refman/5.1/en/grant.html


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Reply With Quote
  #3  
Old   
Kees Nuyt
 
Posts: n/a

Default Re: Syntax error .. but why? - 01-13-2011 , 03:09 AM



On Wed, 12 Jan 2011 19:14:35 -0800 (PST), SpreadTooThin
<bjobrien62 (AT) gmail (DOT) com> wrote:

Quote:
GRANT ALL PRIVILEGES ON *.* TO me @'host.domain' IDENTIFIED BY
'mypassword';

Is giving me a syntax error..
And it tells you where.

GRANT ALL PRIVILEGES ON *.* TO 'me'@'host.domain'

Quote:
I'm on mac os x 10.6
I wonder if this has something to do with how I started mysql?
sudo /usr/local/mysql/bin/mysql
There is no reason to run it as root.

Quote:
Can the password be the same for the same user logging in from a
different workstation?
Is the space necessary before the @?
No, check the syntax description in the manual.

Quote:
are the 's necessary around
host.domain if it's not an IP address?
Just use them. Always.

Quote:
Are 's necessary around the password....
Check the syntax description in the manual. If it states
password is a string literal, you need single quotes.

Quote:
I've tried everything and i just can't get it to work.
Best regards,
--
( Kees Nuyt
)
c[_]

Reply With Quote
  #4  
Old   
Bodo
 
Posts: n/a

Default Re: Syntax error .. but why? - 01-13-2011 , 03:11 AM



Hi,

i'd install MySQLWorkbench und use the server administration there (Accounts, manage users).

It makes things a lot easier to understand even if you want to use command line SQL-commands later.

kind regards,

Bodo

http://dev.mysql.com/downloads/workbench/5.2.html

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.