redis為什么默認(rèn)16個(gè)db php實(shí)現(xiàn)redis數(shù)據(jù)庫(kù)指定庫(kù)號(hào)遷移的方法?
php實(shí)現(xiàn)redis數(shù)據(jù)庫(kù)指定庫(kù)號(hào)遷移的方法?具體代碼如下:namespace appindexcontrollerusethinkdbuse thinkcachedriverredisclass i
php實(shí)現(xiàn)redis數(shù)據(jù)庫(kù)指定庫(kù)號(hào)遷移的方法?
具體代碼如下:namespace appindexcontrollerusethinkdbuse thinkcachedriverredisclass index{public function index(){$config=[“host”=>“server IP address”,“port”=>端口號(hào),“password”=>“redis access password”,“select”=> 0,“timeout”=> 0,“expire”=> 0,“persistent”=> false,“prefix”=>“”,]$Redis=new Redis($config)$Redis->集(“test”,“test”)echo$Redis->集(“test”)}