Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis ERR unknown command 'FLUSHDB'

I deployed a laravel application into AWS EC2. The redis server is installed on another EC2 server.

The connection to the redis server is being initialized successfully. But, whenever I attempt to clear the cache, I get this error:

Predis\Response\ServerException : ERR unknown command 'FLUSHDB', with args beginning with:

If I install redis server locally on the application server, it works fine.

Any idea how to fix it?

P.S: I tried two versions of redis: 4.0.9 and 5.0.7 (both gave me the same error)

like image 907
Mojtaba Avatar asked Aug 25 '26 10:08

Mojtaba


1 Answers

That means FLUSHDB has been disabled. This is a dangerous command, so many admin will disable this command by renaming the command with rename-command configuration in redis.conf or just disable it by rename it to empty string.

rename-command flushdb ""

Check the conf file for detail on command renaming.

like image 193
for_stack Avatar answered Aug 28 '26 01:08

for_stack



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!