title: Can't create table with error no : 150
body: <p>I am using the below create table to create a posts table in mysql :</p>
  
  <pre><code>mysql&gt; create table posts(
      -&gt; post_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
      -&gt; author_id INT NOT NULL,
      -&gt; title varchar(50),
      -&gt; post TEXT,
      -&gt; data DATE,
      -&gt; FOREIGN KEY (author_id)
      -&gt; REFERENCES authors(author_id)
      -&gt; ON DELETE RESTRICT)ENGINE=INNODB;
  </code></pre>
  
  <p>But i always get this error:
  ERROR 1005 (HY000): Can't create table 'myFirstBlog.posts' (errno: 150)</p>
  
  <p>The describe of my authors table is as follows:</p>
  
  <pre><code>mysql&gt; desc authors;
  +-----------+-------------+------+-----+---------+----------------+
  | Field     | Type        | Null | Key | Default | Extra          |
  +-----------+-------------+------+-----+---------+----------------+
  | author_id | int(11)     | NO   | PRI | NULL    | auto_increment |
  | user_name | varchar(16) | YES  |     | NULL    |                |
  | password  | varchar(40) | YES  |     | NULL    |                |
  +-----------+-------------+------+-----+---------+----------------+
  3 rows in set (0.00 sec)
  </code></pre>
  
  <p>Can someone please help me with where the error is .</p>
  
  <p>Thanks in advance.</p>