Skip to content
Advertisement

Why does MYSQL Sleep(x) go on forever?

I have a basic SQL query

DO SLEEP(2)

However, when I run it, it just goes on forever until it reaches a timeout message.

I have already tried

SELECT SLEEP(2)

and it still goes on forever.

There are no error messages, the request just goes on forever.

Advertisement

Answer

You have it to use it like this

SELECT ...
DO SLEEP(5);
SELECT ...

or

UPDATE Table1 SET...
SELECT SLEEP(5);
SELECT ...

Then it will wait 5 Secondes between the sql commands

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement