node.js , mysql too many connections on multiple clicks

Okay i have implemented a like button in my website using node.js/socket.io . Whenever the user clicks the like button the following stuff happens -

1) using jquery i check the data-islike attribute (which is true if the current user has liked the content and false otherwise ) of the button .

2) Depending on whether it is true/false i do a socket.emit with unlike/like .

Now the problem that i am having is , if a user clicks on the like button repeatedly , then instead of like-unlike-like-unlike sequence i have multiple likes and ultimately my server crashes with mysql giving an error stating that there are too many connections . what should i do ?