【问题标题】:How to pass username and password in the localhost url to connect with the memcached in Java?如何在 localhost url 中传递用户名和密码以连接 Java 中的 memcached?
【发布时间】:2013-06-08 09:13:06
【问题描述】:

您好,我想通过用户名和密码连接到我部署了 memcached 的本地主机。

这是我的代码。

import java.io.IOException;
import java.net.InetSocketAddress;

import net.spy.memcached.MemcachedClient;

public class MemCaheConnection {

    public void ConnectMemCaheConnection() throws IOException{

        MemcachedClient c = new MemcachedClient(new InetSocketAddress("localhost", 11211));
        c.flush();
    }
}

谁能帮忙?

【问题讨论】:

    标签: java jakarta-ee memcached spymemcached libmemcached


    【解决方案1】:

    如果没有明确使用http://code.google.com/p/memcached/wiki/SASLAuthProtocol,则不需要用户名+密码,您是否检查了服务是否在端口 11211 上运行?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-06
      • 2011-07-29
      • 1970-01-01
      • 1970-01-01
      • 2022-01-24
      • 2019-04-06
      • 1970-01-01
      • 2021-09-03
      相关资源
      最近更新 更多