Creating MySQL Trigger
You're missing the small keyword BEGIN. And as you have multiple statements, you have to change the delimiter.

DELIMITER $$
Create Trigger Count_McNum
before insert on tension
for each row
BEGIN
declare rowcount int ;
set rowcount = (select count(McNum) from tension where median is null) ;
if (rowcount &gt;1000) 
then 
SIGNAL SQLSTATE '02000' SET MESSAGE_TEXT = 'Warning:  rowcount&gt; 1000!';
    END IF;
End$$
DELIMITER ;