I am not a script person, but let me try to help you figuring out whats wrong.
First I assumed that the user executing the script has the necessary
privileges t update the privilege database /datadir/mysql (for Linux f.e
The second I tried your SQL statement which works just fine.
So if I take out the SQL statement
eval "/path/to/mysql --user=root --password=*****
--socket=/path/to/socket --database=mysql --execute=\"
and then I would like you to take a sharp look at whats left, then there
should perhaps be something with this part above. Perhaps the " at the very
end is not escaped correctly (double) or something similar. The actual SQL
statement works perfectly fine.
2003年 7月 8日 火曜日 08:28、Michael Iatauro さんは書きました:
> I've been having a little trouble creating users cross-platform. I have
> a little script that works just fine on Solaris 8 using this command:
> eval "/path/to/mysql --user=root --password=*****
> --socket=/path/to/socket --database=mysql --execute=\"INSERT INTO user
> (Host, User, Password, Select_priv, Insert_priv, Update_priv,
> Delete_priv, Shutdown_priv, File_priv, Create_tmp_table_priv,
> Lock_tables_priv) VALUES ('localhost', 'LocalUser', PASSWORD('******'),
> 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y')\""
> With the obvious changes to make the statement actually work. However,
> if I move this over to Linux, I get Invalid Authorization Specification
> errors when I try to connect as LocalUser after a reload, and using
> GRANT seems never actually to grant privileges (e.g. no "Y"s in the user
> table). Does anybody know how I can successfully create a user with my
> ~Michael Iatauro
Personal URL: http://www.knowd.co.jp/staff/nils