Does table replyPosts already exist? This error can happen in case you have duplicate foreign key names. use perror with the errno (in your case, its error 150), you should get:
MySQL error code 150: Foreign key constraint is incorrectly formed
After looking at your complete SQL, I think it is down to the fact that linkPostID is INT UNSIGNED when you create LinkPosts table, whereas in ReplyPosts table, linkPostID is INT. Change that to INT UNSIGNED and see if it works.
As per the document here "foreign keys" should have the same size and sign, if it's integer.
As a side note, I would still insist on using UserId as primary key on Users table instead of UserName. Every time you insert a record in Users table, it will be sorted by UserName (since it is primary key, hence clustered index). Bigger the UserName field (Varchar(20)), the longer it takes for sorting the whole table. As your table grows, inserting records into User table is going to get cumbersome.