Read through https://redistogo.com/documentation/introduction_to_redis?language=en but couldn't get it to work.
redis-cli -h my-host -p 1234 -a mypassword
What is my-host?
How to see the database?
The web console seems to not display all the data. keys fails.
redis-cli -h returns "Could not connect to Redis"
On https://redistogo.com/heroku/resources/934839 where your app installs redistogo.
The following link is given:-
redis://redistogo:12340994131cb8c2f2402ffdsafds3333129#birdeye.redistogo.com:3244/
using this you type on console:-
redis-cli -h my-host -p 1234 -a mypassword
redis-cli -h birdeye.redistogo.com -p 3244 -a 12340994131cb8c2f2402ffdsafds3333129
and you will log onto console.
"My-host" is the hostname you get from Redis To Go.
Related
When I connect to Cypher Shell using cmd, I type this:
bin\cypher-shell -u neo4j
Immediately after, I'm prompted for a password. I enter the password and connect to Cypher Shell. Yay!
Now, if I try to connect to Cypher Shell using cmd with this command:
bin\cypher-shell -u neo4j - p <password>
I'm given the error:
The client is unauthorized due to authentication failure
Can somebody explain to me why that is?
Thank you
Use the full connection string for cypher-shell can be in the format:
bin\cypher-shell -a <connection-URI>://<username>:<password>#<host><:port>
or
bin\cypher-shell -a <connection_uri> -u <username> -p <password>
For example:
bin\cypher-shell -a neo4j://neo4juser:neo4jpassword#127.0.0.1:7687
or
bin\cypher-shell -a neo4j://127.0.0.1:7687 -u neo4juser -p neo4jpassword
Redis monitor cmd is not working with authentication:
Cmd: redis-cli -h <redis_endpoint> -p <port> -n <database> -a <password> monitor
error: (error) ERR wrong number of arguments for 'MONITOR' command
But the same works with Redis without authentication:
redis-cli -h <redis_endpoint> -p 6379 monitor
Can someone help with correct redis-cli monitor cmd that works with database and password.
In my redis database, I'm trying to delete a series of keys that start with:
EPOCH_vgsOwnedVehs_
I have tried the following:
redis-cli -h 127.0.0.1 -p myport -a mypassword --scan --pattern EPOCH_vgsOwnedVehs_* | xargs redis-cli unlink
and
redis-cli -h 127.0.0.1 -p myport -a mypassword --scan --pattern EPOCH_vgsOwnedVehs_* | xargs redis-cli -h 127.0.0.1 -p myport -a mypassword unlink
But, I get the following error message:
'xargs' is not recognized as an internal or external command, operable program or batch file.
Could anyone help as to why xargs won't work in this case? I see that same syntax above being mentioned quite a few times here and seems to work for others...
EDIT: I forgot to mention that when I run the first half of the line before the pipe, it does return all the keys that match the criteria.
The following should do the work; (added an example print-out)
redis-cli -h 127.0.0.1 -p 6379 -a mypass --scan --pattern EPOCH_vgsOwnedVehs_* | xargs redis-cli -h 127.0.0.1 -p 6379 -a mypass unlink
127.0.0.1:6379> config set requirepass mypass
OK
127.0.0.1:6379> auth mypass
OK
127.0.0.1:6379> set EPOCH_vgsOwnedVehs_a a
OK
127.0.0.1:6379> set EPOCH_vgsOwnedVehs_b a
OK
127.0.0.1:6379> set EPOCH_vgsOwnedVehs_c a
OK
127.0.0.1:6379> set EPOCH_vgsOwnedVehs_d a
OK
127.0.0.1:6379>
redis-cli -h 127.0.0.1 -p 6379 -a mypass --scan --pattern EPOCH_vgsOwnedVehs_* | xargs redis-cli -h 127.0.0.1 -p 6379 -a mypass unlink
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
(integer) 4
127.0.0.1:6379> auth mypass
OK
127.0.0.1:6379> exists EPOCH_vgsOwnedVehs_a
(integer) 0
xargs is a common Linux utility and the message you are seeing indicates you are using Windows. You have a couple of choices here to get this working - you can find a Windows alternative of xargs, use Cygwin, use Powershell, etc.
I have URL and PORT of remote Redis server. I am able to write into Redis from Scala. However I want to connect to remote Redis via terminal using redis-server or something similar in order to make several call of hget, get, etc. (I can do it with my locally installed Redis without any problem).
redis-cli -h XXX.XXX.XXX.XXX -p YYYY
xxx.xxx.xxx.xxx is the IP address and yyyy is the port
EXAMPLE from my dev environment
redis-cli -h 10.144.62.3 -p 30000
REDIS CLI COMMANDS
Host, port, password and database By default redis-cli connects to the
server at 127.0.0.1 port 6379. As you can guess, you can easily change
this using command line options. To specify a different host name or
an IP address, use -h. In order to set a different port, use -p.
redis-cli -h redis15.localnet.org -p 6390 ping
There are two ways to connect remote redis server using redis-cli:
1. Using host & port individually as options in command
redis-cli -h host -p port
If your instance is password protected
redis-cli -h host -p port -a password
e.g. if my-web.cache.amazonaws.com is the host url and 6379 is the port
Then this will be the command:
redis-cli -h my-web.cache.amazonaws.com -p 6379
if 92.101.91.8 is the host IP address and 6379 is the port:
redis-cli -h 92.101.91.8 -p 6379
command if the instance is protected with password pass123:
redis-cli -h my-web.cache.amazonaws.com -p 6379 -a pass123
2. Using single uri option in command
redis-cli -u redis://password#host:port
command in a single uri form with username & password
redis-cli -u redis://username:password#host:port
e.g. for the same above host - port configuration command would be
redis-cli -u redis://pass123#my-web.cache.amazonaws.com:6379
command if username is also provided user123
redis-cli -u redis://user123:pass123#my-web.cache.amazonaws.com:6379
This detailed answer was for those who wants to check all options.
For more information check documentation: Redis command line usage
In Case of password also we need to pass one more parameter
redis-cli -h host -p port -a password
One thing that confused me a little bit with this command is that if redis-cli fails to connect using the passed connection string it will still put you in the redis-cli shell, i.e:
redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>
You'll then need to exit to get yourself out of the shell. I wasn't paying much attention here and kept passing in new redis-cli commands wondering why the command wasn't using my passed connection string.
if you got Error: Server closed the connection
try with --tls switch:
redis-cli --tls -h my-redis.redis.cache.windows.net -p 6379 -a myRedisPassword
h 👉 hostname
p 👉 port
a 👉 password
I don't have phpMyAdmin installed on a ubuntu server but want to show all mysql processed. I know that you can do a "show_processes" in phpMyAdmin but how can I do it via shell?
Thanks
mysql -u USER -pPASS -P PORT -h HOST < "show processlist"
details:
-u = user
-p = password
-P = port number
-h = HOST
if you want to get the details via information_schema views,
sql="select * from information_schema.processlist where ???"
mysql -u USER -pPASS -P PORT -h HOST < $sql
mysql -uuser -p -e "show full processlist"
or
mysql -uuser -p -e "show processlist"