因为业务需要在默认账号写入数据后,前端需要用只读账号消费数据,在配置里设置了只读账号后服务器上能登录这个账号,但在本地测试远程登录时显示
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");
网上没有找到类似解决方案
我记得6.0不是有username了