The 'SLEEP' command in MySQL is throwing a syntax error:

mysql> sleep(5);

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sleep(5)' at line 1

This is on MySQL 5.6.23. I believe I have used SLEEP on the current version of MySQL on this server in the past, but I'm not sure what could have changed since then.

I've tried restarting the database server, but the problem persists. For what it's worth, the reason I want to use SLEEP is to determine the rate of Queries and Questions running on the server, ie

show global status like 'Qu%'; sleep(60); show global status like 'Qu%';

1 Answer 1


You have to use

select sleep(5);

because it is similar to other mysql functions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.