title: MySQL inserting same rows
body: <p>There is a sql table like that
  <a href="https://i.stack.imgur.com/Yxogr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yxogr.png" alt="enter image description here"></a></p>
  
  <p>Indexes like that
  <a href="https://i.stack.imgur.com/fAc80.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fAc80.png" alt="enter image description here"></a></p>
  
  <pre><code>INSERT INTO users_words(iduser,idword,status_of_word) VALUES(4,6,2);
  INSERT INTO users_words(iduser,idword,status_of_word) VALUES(4,6,1);
  INSERT INTO users_words(iduser,idword,status_of_word) VALUES(4,6,0);
  INSERT INTO users_words(iduser,idword,status_of_word) VALUES(5,6,0);
  INSERT INTO users_words(iduser,idword,status_of_word) VALUES(8,7,1);
  INSERT INTO users_words(iduser,idword,status_of_word) VALUES(8,9,2);
  </code></pre>
  
  <blockquote>
    <p>I want to a unique index is together with iduser,idword.
    How to avoid inserting query with same values together index columns? 
    For example: Bloking row inserting like 13 and 14 ( idusers_words ) rows</p>
  </blockquote>
  
  <pre><code>SELECT * FROM users_words;
  
  &gt; idusers_words  |  iduser | idword | status_of_word |
           12             4       6            2
           13             4       6            1
           14             4       6            0
           15             5       6            0
           16             8       7            1
           17             8       9            2
  </code></pre>
  
  <p>EDIT:</p>
  
  <blockquote>
    <p>I tried this code. But comes that error "#1062 - Duplicate entry '1-1' for key 'my_unique'"</p>
  </blockquote>
  
  <pre><code>ALTER TABLE users_words
  ADD CONSTRAINT my_unique UNIQUE(iduser,idword);
  </code></pre>