title: Ubuntu permissions: file owned by `mysql` can't be deleted by user that's a member of the `mysql` group
body: <p>I'm running Ubuntu 14.04 and am slightly confused about permissions/group membership:</p>
  
  <p>A MySQL query executes and writes a file to the <code>/tmp</code> folder. It's owned by the MySQL user:group :</p>
  
  <pre><code>-rw-rw-r-- 1 mysql mysql     22399 Jun 28 12:17 /tmp/dump.csv
  </code></pre>
  
  <p>I added my user to the MySQL group:</p>
  
  <pre><code>sudo usermod -a -G mysql awoolford
  </code></pre>
  
  <p>If I run <code>id</code> I can see <code>mysql</code> listed in the list of groups:</p>
  
  <pre><code>awoolford@deepthought:~$ id
  uid=1000(awoolford) gid=1000(awoolford) groups=1000(awoolford),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),117(lpadmin),118(sambashare),129(mysql)
  </code></pre>
  
  <p>I wrote a Python script that's executed as my user. It doesn't delete the file despite being a member of the <code>mysql</code> group, e.g.</p>
  
  <pre><code>awoolford@deepthought:~$ python
  Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
  &gt;&gt;&gt; import os
  &gt;&gt;&gt; os.remove('/tmp/dump.csv')
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  OSError: [Errno 1] Operation not permitted: '/tmp/dump.csv'
  </code></pre>
  
  <p>How can I programmatically delete this file without running the script as <code>sudo</code>?</p>