Return-Path: X-Original-To: apmail-incubator-connectors-user-archive@minotaur.apache.org Delivered-To: apmail-incubator-connectors-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 102FEC7A3 for ; Mon, 21 May 2012 09:35:18 +0000 (UTC) Received: (qmail 10875 invoked by uid 500); 21 May 2012 09:35:17 -0000 Delivered-To: apmail-incubator-connectors-user-archive@incubator.apache.org Received: (qmail 10651 invoked by uid 500); 21 May 2012 09:35:13 -0000 Mailing-List: contact connectors-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: connectors-user@incubator.apache.org Delivered-To: mailing list connectors-user@incubator.apache.org Received: (qmail 10615 invoked by uid 99); 21 May 2012 09:35:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 09:35:11 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shigeki.kobayashi3@g.softbank.co.jp designates 74.125.245.86 as permitted sender) Received: from [74.125.245.86] (HELO na3sys010aog109.obsmtp.com) (74.125.245.86) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 21 May 2012 09:35:05 +0000 Received: from mail-qa0-f42.google.com ([209.85.216.42]) (using TLSv1) by na3sys010aob109.postini.com ([74.125.244.12]) with SMTP ID DSNKT7oMM9HoiWkf1ExAZQ+z6VCBsWJSp4Zs@postini.com; Mon, 21 May 2012 02:34:45 PDT Received: by qafi31 with SMTP id i31so1359613qaf.15 for ; Mon, 21 May 2012 02:34:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :x-gm-message-state; bh=u8hdg5cw2A2IfHzqwmnaUWsO2kvWgZQt+f6ocaenafM=; b=kL6ATtSwJKwhefpAsB9X4JPtOKMVQPt7RlkS2G55qD/zdeOrPsPdZu7UjIBYr+Li3z Wrnc85m92spUSkk/R05XxWeafm+9urQ7+6hojD+ym5mBeXoKnImUHKDo2EkXzcHrPQdQ E1ub+IBxZJ8a1eXW/ZHr6NDDfmRT5SW88E6IaEug3qME2+jsLjDQuNQAkpf3dRYXTvFe ty6kzEMD8mQQOb8qXKecxJnKwtfAiyfIEGNW6+KZlTt8dr1S/k/evrhSX2NTZChzT373 tQtI2ElGBU4ur55ECtQBeB68ER+DsEEADQlnum2qjO4/z4dLX7Din3dN3+/wi4yesBeh 31Bw== Received: by 10.224.212.5 with SMTP id gq5mr37700080qab.1.1337592883300; Mon, 21 May 2012 02:34:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.26.9 with HTTP; Mon, 21 May 2012 02:34:02 -0700 (PDT) From: Shigeki Kobayashi Date: Mon, 21 May 2012 18:34:02 +0900 Message-ID: Subject: When running on MySQL initialize.sh causes access denied error To: connectors-user@incubator.apache.org Content-Type: multipart/alternative; boundary=20cf300fb0c7a9c7bd04c0889c76 X-Gm-Message-State: ALoCoQlcFuK2wKB1iq0CRPlkYs3DZknslv3bCBR+ju79JcNopsTRY4I5jvlOJZm7XNm15vpNuq1k X-Virus-Checked: Checked by ClamAV on apache.org --20cf300fb0c7a9c7bd04c0889c76 Content-Type: text/plain; charset=UTF-8 Hi guys. I suppose some pepole use multiple servers to create MCF-MySQL environtment. Well, I'm one of them but I found that initialize.sh causes access denied error if DB server is seperated from MCF's. Suppose each server's IP are like followings: MySQL Server IP: A MCF Server IP: B and properties.xml has the follwing parameters and values: Then, executing initialize.sh causes the follwing error: Caused by: java.sql.SQLException: Access denied for user 'manifoldcf'@'B' (using password: YES) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:943) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4113) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1308) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2336) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2369) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153) at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:792) at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) The problem is that MCF requests MySQL to create a new "manifoldcf" user with localhost access. In this case, of course, MCF is on the server with IP B, MySQL should create a new user with IP Address B. The following method is the one creating a new MySQL user in the user table. Modifying the part where IP information is added solves this problem. JAR NAME :mcf-core.jar PACKAGE :org.apache.manifoldcf.core.database CLASS NAME :DBInterfaceMySQL METHOD NAME: public void createUserAndDatabase if(userName != null) try { list.clear(); list.add(userName); // list.add("localhost"); list.add(IP_ADDRESS_B); list.add(password); ... ... } I guess it would be nice if properties.xml can have a new property taking MCF server IP to have MySQL create a "manifoldcf" user with that IP. What do you think? Regards, Shigeki --20cf300fb0c7a9c7bd04c0889c76 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi guys.

I suppose some pepole= use multiple servers to create MCF-MySQL environtment.
Well, I&#= 39;m one of them but I found that initialize.sh causes access denied error = if DB server is seperated from MCF's.

Suppose each server's IP are like followings:
=

MySQL Server IP: A
MCF Server IP: B

and properties.xml has the follwing parameters and values:<= /div>

=C2=A0<property name=3D"org.apache.manifoldcf.d= atabaseimplementationclass" value=3D"org.apache.manifoldcf.core.d= atabase.DBInterfaceMySQL"/>
=C2=A0<property name=3D&qu= ot;org.apache.manifoldcf.dbsuperusername" value=3D"root"/>= ;
=C2=A0<property name=3D"org.apache.manifoldcf.dbsuperuserpassw= ord" value=3D"<password>"/>
=C2=A0<pro= perty name=3D"org.apache.manifoldcf.database.name" value=3D&quo= t;manifoldcf"/>
=C2=A0<property name=3D"org.apache.manifoldcf.mysql.server&quo= t; value=3D"A"/>

Then, executing init= ialize.sh causes the follwing error:

Caused by: ja= va.sql.SQLException: Access denied for user 'manifoldcf'@'B'= ; (using password: YES)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.mysql.jdbc.SQLError.createSQLExcept= ion(SQLError.java:1073)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.mysql.= jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.mysql.jdbc.MysqlIO.checkErrorPacket= (MysqlIO.java:943)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.mysql.jdbc.= MysqlIO.secureAuth411(MysqlIO.java:4113)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1308)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.mysql.jdbc.ConnectionImpl.coreConne= ct(ConnectionImpl.java:2336)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.m= ysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2369)
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.mysql.jdbc.ConnectionImpl.createNewI= O(ConnectionImpl.java:2153)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.mysql.jdbc.ConnectionImpl.<init&= gt;(ConnectionImpl.java:792)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at com.m= ysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 at sun.reflect.NativeConstructorAccessorImpl.ne= wInstance0(Native Method)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 at sun.reflect.NativeConstructorAccessorIm= pl.newInstance(NativeConstructorAccessorImpl.java:39)

<= div>The problem is that MCF requests MySQL to create a new "manifoldcf= " user with localhost access.
In this case, of course, MCF is on the server with IP B, MySQL should = create a new user with IP Address B.

The following method is the one creating a new MySQL us= er in the user table.=C2=A0
Modifying the part where IP informati= on is added solves this problem.


JA= R NAME =C2=A0 :mcf-core.jar
PACKAGE =C2=A0 =C2=A0:org.apache.manifoldcf.core.database
CL= ASS NAME :DBInterfaceMySQL
METHOD NAME: public void createUserAnd= Database

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= if(userName !=3D null)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 try
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 list.= clear();
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 list.add(userName);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0// =C2=A0 =C2=A0 list.add("localhost");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 lis= t.add(IP_ADDRESS_B);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = list.add(password);
<= /span>...
...<= /div>
}


I guess it would be nice if properties.x= ml can have a new property taking MCF server IP to
have MySQL cre= ate a "manifoldcf" user with that IP. What do you think?


Regards,

Shigek= i


--20cf300fb0c7a9c7bd04c0889c76--