Squid3 – 无法使用Mysql对用户名/密码进行身份validation

我正在用squid_passwd文件和Mysqltesting两个身份validation。 这是我的configuration

auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/squid_passwd # auth_param basic program /usr/lib/squid3/basic_db_auth --dsn "DBI:mysql:database=abc" --user "root" --password "aaa" --table "user" --usercol "User_Name" --passwdcol "Password" --cond "" --plaintext auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 1 minute auth_param basic casesensitive off # auth_param basic children 5 # auth_param basic realm Squid proxy-caching web server # acl blocked dstdomain .google.com.vn .google.com.sg acl db_auth proxy_auth REQUIRED # acl restricted_users proxy_auth "/etc/squid3/restrictedusers" # http_access deny restricted_users blocked http_access allow db_auth # And finally deny all other access to this proxy http_access deny all 

这是squid_passwd的内容

 a2:$apr1$ovwnKYTS$hashedPassword a1:$apr1$ovwnKYTS$hashedPassword 

当我使用squid_passwd ,它工作正常(我设置为Firefox的代理,然后用用户名/密码成功login

但是,当我使用Mysqlconfiguration(使用squid_passwd注释该行并且使用Mysql注释该行),我无法login到代理服务器,甚至testing命令

 /usr/lib/squid3/basic_db_auth --dsn "DBI:mysql:database=abc" --user "root" --password "aaa" --table "user" --usercol "User_Name" --passwdcol "Password" --cond "" --plaintext a1 password OK 

(而且squid的cache.log也表示authentication成功)

这是我的用户表

 mysql> select User_Name, Password from user; +-----------+----------+ | User_Name | Password | +-----------+----------+ | a1 | password | | a2 | password | +-----------+----------+ 

我在这里做错了什么?

尝试在系统中禁用SELinux。 这将解决这个问题。