MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:doug Date:July 31 2011 3:38pm
Subject:granting file privileges
View as plain text  
I have both a theory question and a question on implementation of privileges. 
First theory. I have been using:

    grant all privileges on db-name.* to user@localhost
       identified by 'password';

Because I blunder about as root I never was impacted by 'file' being a global 
permission. As 'load infile' seems (to me) to be equivalant to 'insert' I do not 
see the reason for this. If its just a historical thing, so be it, but IMO it 
makes little sense that a user could create and/or delete a table but to import 
data he is required to convert a csv file to 'insert value' statements.

My implementation question is about specifying the user. Apparently the 
following are different:

    1) user@localhost
    2) 'user@localhost'
    3) 'user'@'localhost'

I have not tested all this, but I did grant file privileges to #1 but could not 
use them logging into with 'mysql -u doug@localhost sysadmin' ('doug' being 
setup without a password).

The question is which form should be used and why are they different as all are 
accepted without error and all add entries for the users and db tables.

Douglas Denault
Voice: 301-217-9220
   Fax: 301-217-9277
granting file privilegesdoug31 Jul
  • Re: granting file privilegesClaudio Nanni31 Jul
    • Re: granting file privilegesdoug31 Jul