title: passwords and permissions in MySQL
body: <p>This might come across as a simple question, but I have very limited experience with relational databases. How do I fine tune permissions in MySQL. For example, if I have the following code</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS user(
  ID INT NOT NULL AUTO_INCREMENT,
  
  //...other columns
  
  PRIMARY KEY(ID)
  )ENGINE=InnoDB
  
  
  
  CREATE TABLE IF NOT EXISTS pictures
  (
  ID INT NOT NULL AUTO_INCREMENT,
  userID INT NOT NULL,
  
  //...other columns
  
  PRIMARY KEY(ID),
  FOREIGN KEY (userID) REFERENCES user(ID)
  )ENGINE=InnoDB";
  </code></pre>
  
  <p>and I create two new users, <code>user1</code> and <code>user2</code>, I can give them permission to the tables as such</p>
  
  <pre><code>GRANT ALL PRIVILIGES ON db_name.* to ".user1."@\"%\" identified by ".pass1
  GRANT ALL PRIVILIGES ON db_name.* to ".user2."@\"%\" identified by ".pass2
  </code></pre>
  
  <p>but is there anywhere to restrict privileges inside a table to only a specific subset? Should I carry this out in my PHP code instead? I'm used to object oriented programming, so I am not accustomed to massive tables which hold all the information.</p>