mchristy215 Posted September 17, 2008 Share Posted September 17, 2008 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) , 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. -m Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 17, 2008 Share Posted September 17, 2008 Use `` (backticks, not quotes '') around server's name. If that's the reason of the error, it should help. Quote Link to comment Share on other sites More sharing options...
mchristy215 Posted September 17, 2008 Author Share Posted September 17, 2008 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. Quote Link to comment Share on other sites More sharing options...
mchristy215 Posted September 17, 2008 Author Share Posted September 17, 2008 figgerd it out. I ended up with this final product: GRANT ALL PRIVILEGES ON *.* TO 'wiki_user'@'linsrv-a' IDENTIFIED BY 'wiki_password' WITH GRANT OPTION; thanks for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.