1

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%';
asked May 27, 2015 at 7:32

1 Answer 1

3

You have to use

select sleep(5);

because it is similar to other mysql functions.

answered May 27, 2015 at 7:37

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.