【已解决】redis6版本设置了只读账号,webman无法远程登录

fantasmic

问题描述

因为业务需要在默认账号写入数据后,前端需要用只读账号消费数据,在配置里设置了只读账号后服务器上能登录这个账号,但在本地测试远程登录时显示

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");

为此你搜索到了哪些方案及不适用的原因

网上没有找到类似解决方案

419 1 0
1个回答

小W

我记得6.0不是有username了

  • 暂无评论
🔝