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 [email protected] 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 [email protected] 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
https://forums.phpfreaks.com/topic/124691-solved-grant-statement/
Share on other sites

Yah did that, now i get the following error:

 

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

 

In the user table I changed the User field to "30" using phpmyadmin, but that doesn't seem to have helped.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.