0
0
Redisquery~10 mins

Connection configuration in Redis - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to connect to Redis on the default host and port.

Redis
redis_client = redis.Redis(host=[1])
Drag options to blanks, or click blank then click option'
A"remotehost"
B"127.0.0.1"
C"localhost"
D"0.0.0.0"
Attempts:
3 left
💡 Hint
Common Mistakes
Using an IP address that is not local.
Leaving the host empty.
2fill in blank
medium

Complete the code to connect to Redis on port 6380 instead of the default 6379.

Redis
redis_client = redis.Redis(port=[1])
Drag options to blanks, or click blank then click option'
A6379
B6380
C3306
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using the default port 6379 by mistake.
Using unrelated port numbers like 3306 (MySQL) or 8080 (HTTP).
3fill in blank
hard

Fix the error in the code by completing the password parameter to connect securely.

Redis
redis_client = redis.Redis(password=[1])
Drag options to blanks, or click blank then click option'
A"mypassword"
BTrue
C12345
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Using None which means no password.
Using a number or boolean instead of a string.
4fill in blank
hard

Fill both blanks to connect to Redis on host "redis-server" and port 7000.

Redis
redis_client = redis.Redis(host=[1], port=[2])
Drag options to blanks, or click blank then click option'
A"redis-server"
B6379
C7000
D"localhost"
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping host and port values.
Using default port 6379 instead of 7000.
5fill in blank
hard

Fill all three blanks to connect to Redis with host "cache", port 6381, and password "secret".

Redis
redis_client = redis.Redis(host=[1], port=[2], password=[3])
Drag options to blanks, or click blank then click option'
A"cache"
B6381
C"secret"
D6379
Attempts:
3 left
💡 Hint
Common Mistakes
Using default port 6379 instead of 6381.
Not quoting the password string.