Jump to content

[SOLVED] GRANT statement


mchristy215

Recommended Posts

Howdy,

 

I've taken a few courses in SQL, but i've never really worked with it a lot. I'm trying to set up a databse according to installation instructions on a Unbuntu box running mysql 5. Here are the directions:

 

Note: Linux users need to execute these statements twice. First using "localhost" and "localhost.localdomain", then using the host and domain names stored in /etc/hosts. Example using "mylocahost" and "mylocalhost.mylocaldomain":

 

GRANT ALL PRIVILEGES ON *.* TO wiki_user@mylocalhost IDENTIFIED BY 'wiki_password' WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* TO wiki_user@mylocalhost.mylocaldomain IDENTIFIED BY 'wiki_password' WITH GRANT OPTION;

 

So, I'd like to have these statemens changed to the following:

GRANT ALL PRIVILEGES ON *.* TO wiki_user@linsrv-a IDENTIFIED BY 'wiki_password' WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* TO wiki_user@linsrv-a.domain.local IDENTIFIED BY 'wiki_password' WITH GRANT OPTION;

 

when i execute the command, i get the following error:

 

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-backup IDENTIFIED BY 'wiki_password' WITH GRANT OPTION' at line 1.

 

Now, I'm SMART enough to figure out it's because my server name in the string has a "-" in the name (I THINK) 8), but can someone help me out on what I should do about the syntax to have it include my string as above?

 

I tried the following:

 

mysql> GRANT ALL PRIVILEGES ON *.* TO 'wiki_user@linsrv-a' IDENTIFIED BY 'wiki_password' WITH GRANT OPTION;

 

but i got the following error:

 

ERROR 1470 (HY000): String 'wiki_user@linsrv-a' is too long for user name (should be no longer than 16)

 

then i tried this...

 

mysql> GRANT ALL PRIVILEGES ON *.* TO wiki_user@'linsrv-a' IDENTIFIED BY 'wiki_password' WITH GRANT OPTION;

 

and got:

 

Query OK, 0 rows affected (0.00 sec)

 

.. but it says 0 rows affected.. this would tell me it didn't really do anything.

 

 

 

Thanks in advance. ;D

 

-m

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.