You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@manifoldcf.apache.org by "Karl Wright (JIRA)" <ji...@apache.org> on 2012/05/22 03:31:41 UTC

[jira] [Updated] (CONNECTORS-476) When running on MySQL initialize.sh causes access denied error

     [ https://issues.apache.org/jira/browse/CONNECTORS-476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Wright updated CONNECTORS-476:
-----------------------------------

    Description: 
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:

{code}
 <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"/>
{code}

Then, executing initialize.sh causes the follwing error:

{code}
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)
{code}

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

{code}
            if(userName != null)
                try
                {
                    list.clear();
                    list.add(userName);
             //     list.add("localhost");
                    list.add(IP_ADDRESS_B);
                    list.add(password);
		     ...
		     ...
		}
{code}

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.

  was:
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.

    
> When running on MySQL initialize.sh causes access denied error
> --------------------------------------------------------------
>
>                 Key: CONNECTORS-476
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-476
>             Project: ManifoldCF
>          Issue Type: Improvement
>          Components: Framework core
>    Affects Versions: ManifoldCF 0.5
>            Reporter: Shigeki Kobayashi
>
> 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:
> {code}
>  <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"/>
> {code}
> Then, executing initialize.sh causes the follwing error:
> {code}
> 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)
> {code}
> 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
> {code}
>             if(userName != null)
>                 try
>                 {
>                     list.clear();
>                     list.add(userName);
>              //     list.add("localhost");
>                     list.add(IP_ADDRESS_B);
>                     list.add(password);
> 		     ...
> 		     ...
> 		}
> {code}
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira