CREATEDB

AttentionThis page documents an earlier version. Go to the latest (v2.1)version.

Synopsis

CREATEDB is used to create a new yedis database. All databases other than the default database (“0”) need to be created before use.

A client can issue the CREATEDB command through the redis-cli.This is required before issuing a SELECT command to start using the database.

Return Value

Returns a status string, if creating the database was successful. Returns an error message upon error.

Examples

You can do this as shown below.

  1. $ LISTDB
  1. 1) "0"
  1. $ CREATEDB "second"
  1. "OK"
  1. $ LISTDB
  1. 1) "0"
  2. 2) "second"
  1. $ CREATEDB "3.0"
  1. "OK"
  1. $ LISTDB
  1. 1) "0"
  2. 2) "3.0"
  3. 3) "second"

See Also

createdblistdbdeletedbflushdbflushallselect