php代码:
<?php
class test {
function tester(){
$redis = new Predis\Client(array(
'scheme' => 'tcp',
'host' => 'localhost',
'port' => '6379',
'password => 'test'
));
for($i=0;$i<10;$i++){
$redis->set($i,'a');
}
}
}
和分贝显示:
1) "0" a
2) "1" a
3) "2" a
4) "3" a
5) "4" a
6) "5" a
7) "6" a
8) "7" a
9) "8" a
10) "9" a
很好,但是当我停止服务器并重新启动时,数据库是空的。停止服务器后,我该怎么做才能使键不删除?