因?yàn)闃I(yè)務(wù)需要在默認(rèn)賬號寫入數(shù)據(jù)后,前端需要用只讀賬號消費(fèi)數(shù)據(jù),在配置里設(shè)置了只讀賬號后服務(wù)器上能登錄這個賬號,但在本地測試遠(yuǎn)程登錄時顯示
RedisException: WRONGPASS invalid username-password pair or user is disabled. in xxxx\vendor\illuminate\redis\Connectors\PhpRedisConnector.php:87
//redis.php
return [
'default' => [
'host' => 'xxxxxxxxxx',
'password' => 'xxxxxxxxxx',
'port' => 6379,
'database' => 5,
],
'readuser' => [
'host' => 'xxxxxxxxxx',
'password' => 'xxxxxxxxxx',
'port' => 6379,
'database' => 5,
],
];
//test.php
$redis = Redis::connection('readuser');
$redis->get("link");
網(wǎng)上沒有找到類似解決方案