Redis itself does not differentiate between the case of commands, which are all lowercase, and the following are some simple commands.1.keys (... Get all the key information, if the amount of data is large, will affect performance, output will only output the key name, preceded by an ordinal prefix, parameter support regular.127.0.0.1:6379>Keys F*1) "Fo"2) "F"127
Get ready:Compress package to drag directlytar-zxf redis-3.0.0.tar.gz (root directory) Yum install gcc-c++ (c locale) CD redis-3.0.0 make (C language Compilation)Installation make install Prefix=/usr/local/redisBack-end Boot cp/root/redis-3.0.0/redis.conf./(copy files to bin)Modify file Vi/vim redis.conf daemonize Yeslinux Find/keyword down nStart: ./
How to Use Redis SORT sorting commands
I believe that you do not know much about Redis SORT sorting commands. Therefore, I have compiled some methods and examples of using Redis SORT sorting commands. I hope the examples can help
Mysql, sqlsever, oracle, redis, mongo, postgres and other database backup and recovery commands, sqlseverredis
The following is a simple example of how to back up and restore each database. For more detailed parameters and configurations, refer to relevant information.
I. mysql:
Parameter description:
$ User
$ Password
$ Targethost
$ Port
$ Charset
$ Dbname
$ Table
$ Filename
---llen command: Return the length of the list, here MyList only 4 data left, so the output is 4127.0.0.1:6379>lindex mylist 3---lindex command: Gets the data for the given position, where the data at coordinates 3 is "2", so the result is 2.4. The list data modification command in Redis: LSet127.0.0.1:6379>lset mylist 2 zlh---lset command: Set the value of subscript 2 to ZLH and return an error if the subscript value goes out of range or an empty lis
SK) Client SetName (set the connection name) client GetName (get the current connection name) client Pause timeout (stop Processing commands from clients for some time) client reply On|off|skip (instruct the server whether to reply to commands) Command (get array of redis command details) command count (get total number of
Reprint: http://ju.outofmemory.cn/entry/330999
There are 3 commands for clearing data in Redis, namely: Flushall, Flushdb, SCRIPT FLUSH. Flushall [ASYNC]
Indicates that all data in all db is deleted. The default is a synchronous operation, and the option async means asynchronous, that is, the empty operation takes place in a new thread and does not block the main thread.
$
SET command dynamically adjusts the configuration of the Redis server without having to reboot
Dbsize
Returns the number of keys for the current database
DEBUG OBJECT
Debug OBJECT is a debug command that should not be used by the client
DEBUG Segfault
Perform an illegal memory access so that Redis crashes and is only used for BUG simulations at devel
SET command dynamically adjusts the configuration of the Redis server without having to reboot
Dbsize
Returns the number of keys for the current database
DEBUG OBJECT
Debug OBJECT is a debug command that should not be used by the client
DEBUG Segfault
Perform an illegal memory access so that Redis crashes and is only used for BUG simulations at devel
Redis server
CONFIG SET
The Config SET command dynamically adjusts the configuration of the Redis server without having to reboot
Dbsize
Returns the number of keys for the current database
DEBUG OBJECT
Debug OBJECT is a debug command that should not be used by the client
DEBUG Segfault
Perform an illegal memory access so that
transaction and discard all commands of the transaction block. If you are using watch monitoring, all monitoring will be canceled.Time Complexity: O (1)Return Value: Always Returns OK
WatchFormat: wathc key [key...]Specifies the KEY (multiple keys) to be monitored. If this (or these) key is changed by other commands before the transaction is executed, the transaction will be interrupted.Time Complexity: O
Redis 3 All commands
Note: This article refer to Redis Chinese web, content update. The list of commands in the redis.cn redis Chinese network is Redis version 2.8, this article is the latest
SET command dynamically adjusts the configuration of the Redis server without having to reboot
Dbsize
Returns the number of keys for the current database
DEBUG OBJECT
Debug OBJECT is a debug command that should not be used by the client
DEBUG Segfault
Perform an illegal memory access so that Redis crashes and is only used for BUG simulations at devel
Redis provides a rich command to manipulate databases and various data types, which can be used on Linux endpoints. In programming, such as various language packs, these commands have a corresponding method. The following is a summary of the commands provided by Redis.Related articles: redis Common Command Manual: key-
Redis Common management commands:
bgrewriteaof
Asynchronously (asynchronously) rewrites the AoF file to reflect the state of the current database.
Even if the bgrewriteaof command fails, the data in the old aof file will not be lost or changed. Bgsave
Asynchronously saves data from the current database to disk in the background.
The Bgsave command returns OK immediately after execution, then
The Flushall flushdb command clears the data and never fails, which is dangerous for online clusters.
The KEYS * command, when used when the data scale is large, can seriously affect redis performance and is very dangerous.
What if these risks are fundamentally circumvented?
Redis provides a very simple and efficient way to set the disable commands directly in
The Flushall flushdb command empties data and never fails, and is very dangerous for online clusters.
The KEYS * command, when used with large data sizes, can severely affect Redis performance and are also very dangerous.
What if these risks are fundamentally circumvented.
Redis provides a very simple and efficient way to set up disabling these commands direct
, respectively, from the left pop-up, from the right pop-up, the return value is a pop-up value. (pop-up means to remove the value and return the value)
127.0.0.1:6379> lrange mylist 0-1
1) "-2"
2) "-1"
3 "" 0 "
4)" 1 "
127.0.0.1:6379> Lpop MyList
"-2"
127.0.0.1:6379> rpop mylist
"1"
127.0.0.1:6379> lrange mylist
-0-1 1) "-1"
2) "0"
Combined with the above four commands, you can implement stacks and queues.
Stacks: lpush and lpop or usin
Redis InstallationLinux under the Environment install Redis, I download here is 3.0.0 version (currently the latest 3.2.0).wget http://download.redis.io/releases/redis-3.0.0.tar.gztar xzf redis- 3.0. 0. Tar . gz$ CD Redis-3.0. 0 makeSo
returns the key types X_______________________________________________________________________________________________________________ ___________________________Server-related commandsPing tests if the connection is aliveEchoSelect 0-15QuitDbsize returns the number of keys in the current databaseInfo Redis InformationConfig get returns the value of the related configurationFLUSHDB Delete all keys in the currently selected databaseFlushall Delete all
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.