OK, I posted a ticket as CONNECTORS-476. Thanks.
Shigeki 2012/5/21 Karl Wright <[email protected]> > This sounds like a reasonable fix. > > Would you be so kind as to create a ticket, and attach your proposed > change? Adding a special property for mysql is also reasonable. > > Karl > > On Mon, May 21, 2012 at 5:34 AM, Shigeki Kobayashi > <[email protected]> wrote: > > > > 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: > > > > <property name="org.apache.manifoldcf.databaseimplementationclass" > > value="org.apache.manifoldcf.core.database.DBInterfaceMySQL"/> > > <property name="org.apache.manifoldcf.dbsuperusername" value="root"/> > > <property name="org.apache.manifoldcf.dbsuperuserpassword" > > value="<password>"/> > > <property name="org.apache.manifoldcf.database.name" > value="manifoldcf"/> > > <property name="org.apache.manifoldcf.mysql.server" value="A"/> > > > > 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.<init>(ConnectionImpl.java:792) > > at com.mysql.jdbc.JDBC4Connection.<init>(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 > > > > >
