You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@manifoldcf.apache.org by Nigel Thomas <ni...@york.ac.uk> on 2012/11/02 16:21:21 UTC
ManifoldCF 1.0.1 MySQL setup : Error getting connection: Access
denied for user
Hello,
I am having some problems configuring 1.0.1 to use a MySQL database, I
have followed steps here :
http://manifoldcf.apache.org/release/release-1.0.1/en_US/how-to-build-and-deploy.html#Configuring+a+MySQL+database
I have set the following db related properties in properties.xml:
<property name="org.apache.manifoldcf.databaseimplementationclass"
value="org.apache.manifoldcf.core.database.DBInterfaceMySQL"/>
<property name="org.apache.manifoldcf.mysql.server"
value="mysql.example.com"/>
<property name="org.apache.manifoldcf.dbsuperusername" value="root"/>
<property name="org.apache.manifoldcf.dbsuperuserpassword" value="password"/>
<property name="org.apache.manifoldcf.database.name" value="manfold_db"/>
<property name="org.apache.manifoldcf.database.username" value="root"/>
<property name="org.apache.manifoldcf.database.password" value="password"/>
<property name="org.apache.manifoldcf.database.maxhandles" value="100"/>
On running initialise.sh, the following exception is thrown:
org.apache.manifoldcf.core.interfaces.ManifoldCFException: Error
getting connection: Access denied for user 'root'@'%' to database
'mysql'
at org.apache.manifoldcf.core.database.DBInterfaceMySQL.createUserAndDatabase(DBInterfaceMySQL.java:624)
at org.apache.manifoldcf.core.system.ManifoldCF.createSystemDatabase(ManifoldCF.java:700)
at org.apache.manifoldcf.crawler.system.ManifoldCF.createSystemDatabase(ManifoldCF.java:168)
at org.apache.manifoldcf.crawler.InitializeAndRegister.doExecute(InitializeAndRegister.java:37)
at org.apache.manifoldcf.crawler.InitializeAndRegister.main(InitializeAndRegister.java:60)
I am able to connect to the MySQL instance using a command line MySQL
client from the same machine using the same credentials, this rules
out networking and credentials related issues.
Am not sure what I am missing with the setup, I have tried the
equivalent with a postgres setup, this seems to work just fine.
Thanks,
Nigel Thomas
Re: ManifoldCF 1.0.1 MySQL setup : Error getting connection: Access
denied for user
Posted by Karl Wright <da...@gmail.com>.
The check-for-existence logic is already there, and you can control
the superuser name and password. But you can't control the instance
name, which is the MySql root instance name "mysql".
Karl
On Mon, Nov 5, 2012 at 7:00 AM, Nigel Thomas <ni...@york.ac.uk> wrote:
> Hi Karl,
>
> Thank you for the prompt response.
>
> I had run a tcp dump on the connection to get more details on the
> error, which is a mysql :42000 - Access denied for user" error and
> looking at the source code, the problem is not that it isn't
> connecting to the database but, it doesn't have the privileges to
> create the database and grant access to users. We run a shared mysql
> services, where the user, database and privileges are granted
> separately, and unfortunately super user access isn't permitted.
>
> I guess in this context the initialise script will not work without
> some modification to check if database and users already exist.
>
> I have reverted to using postgres instance with full privileges for
> the moment and may revisit the code later.
>
> Thanks for the help.
>
> Nigel Thomas
>
>
> On 2 November 2012 15:35, Karl Wright <da...@gmail.com> wrote:
>> Hi Nigel,
>>
>> I'm not a MySQL expert, but I seem to recall there was something
>> interesting about the way MySQL authenticated remote connections.
>> There are two properties that the MySQL driver looks at:
>>
>> /** MySQL server property */
>> public static final String mysqlServerProperty =
>> "org.apache.manifoldcf.mysql.server";
>> /** Source system name or IP */
>> public static final String mysqlClientProperty =
>> "org.apache.manifoldcf.mysql.client";
>>
>>
>> I think you may need to set both of these for the auth to succeed.
>> Also, make sure your MySQL server is configured to permit connections
>> from the source system you are trying to connect from.
>>
>> Thanks,
>> Karl
>>
>> On Fri, Nov 2, 2012 at 11:21 AM, Nigel Thomas <ni...@york.ac.uk> wrote:
>>> Hello,
>>>
>>> I am having some problems configuring 1.0.1 to use a MySQL database, I
>>> have followed steps here :
>>> http://manifoldcf.apache.org/release/release-1.0.1/en_US/how-to-build-and-deploy.html#Configuring+a+MySQL+database
>>>
>>> I have set the following db related properties in properties.xml:
>>>
>>> <property name="org.apache.manifoldcf.databaseimplementationclass"
>>> value="org.apache.manifoldcf.core.database.DBInterfaceMySQL"/>
>>> <property name="org.apache.manifoldcf.mysql.server"
>>> value="mysql.example.com"/>
>>> <property name="org.apache.manifoldcf.dbsuperusername" value="root"/>
>>> <property name="org.apache.manifoldcf.dbsuperuserpassword" value="password"/>
>>> <property name="org.apache.manifoldcf.database.name" value="manfold_db"/>
>>> <property name="org.apache.manifoldcf.database.username" value="root"/>
>>> <property name="org.apache.manifoldcf.database.password" value="password"/>
>>> <property name="org.apache.manifoldcf.database.maxhandles" value="100"/>
>>>
>>> On running initialise.sh, the following exception is thrown:
>>>
>>> org.apache.manifoldcf.core.interfaces.ManifoldCFException: Error
>>> getting connection: Access denied for user 'root'@'%' to database
>>> 'mysql'
>>> at org.apache.manifoldcf.core.database.DBInterfaceMySQL.createUserAndDatabase(DBInterfaceMySQL.java:624)
>>> at org.apache.manifoldcf.core.system.ManifoldCF.createSystemDatabase(ManifoldCF.java:700)
>>> at org.apache.manifoldcf.crawler.system.ManifoldCF.createSystemDatabase(ManifoldCF.java:168)
>>> at org.apache.manifoldcf.crawler.InitializeAndRegister.doExecute(InitializeAndRegister.java:37)
>>> at org.apache.manifoldcf.crawler.InitializeAndRegister.main(InitializeAndRegister.java:60)
>>>
>>> I am able to connect to the MySQL instance using a command line MySQL
>>> client from the same machine using the same credentials, this rules
>>> out networking and credentials related issues.
>>>
>>> Am not sure what I am missing with the setup, I have tried the
>>> equivalent with a postgres setup, this seems to work just fine.
>>>
>>> Thanks,
>>>
>>>
>>> Nigel Thomas
Re: ManifoldCF 1.0.1 MySQL setup : Error getting connection: Access
denied for user
Posted by Nigel Thomas <ni...@york.ac.uk>.
Hi Karl,
Thank you for the prompt response.
I had run a tcp dump on the connection to get more details on the
error, which is a mysql :42000 - Access denied for user" error and
looking at the source code, the problem is not that it isn't
connecting to the database but, it doesn't have the privileges to
create the database and grant access to users. We run a shared mysql
services, where the user, database and privileges are granted
separately, and unfortunately super user access isn't permitted.
I guess in this context the initialise script will not work without
some modification to check if database and users already exist.
I have reverted to using postgres instance with full privileges for
the moment and may revisit the code later.
Thanks for the help.
Nigel Thomas
On 2 November 2012 15:35, Karl Wright <da...@gmail.com> wrote:
> Hi Nigel,
>
> I'm not a MySQL expert, but I seem to recall there was something
> interesting about the way MySQL authenticated remote connections.
> There are two properties that the MySQL driver looks at:
>
> /** MySQL server property */
> public static final String mysqlServerProperty =
> "org.apache.manifoldcf.mysql.server";
> /** Source system name or IP */
> public static final String mysqlClientProperty =
> "org.apache.manifoldcf.mysql.client";
>
>
> I think you may need to set both of these for the auth to succeed.
> Also, make sure your MySQL server is configured to permit connections
> from the source system you are trying to connect from.
>
> Thanks,
> Karl
>
> On Fri, Nov 2, 2012 at 11:21 AM, Nigel Thomas <ni...@york.ac.uk> wrote:
>> Hello,
>>
>> I am having some problems configuring 1.0.1 to use a MySQL database, I
>> have followed steps here :
>> http://manifoldcf.apache.org/release/release-1.0.1/en_US/how-to-build-and-deploy.html#Configuring+a+MySQL+database
>>
>> I have set the following db related properties in properties.xml:
>>
>> <property name="org.apache.manifoldcf.databaseimplementationclass"
>> value="org.apache.manifoldcf.core.database.DBInterfaceMySQL"/>
>> <property name="org.apache.manifoldcf.mysql.server"
>> value="mysql.example.com"/>
>> <property name="org.apache.manifoldcf.dbsuperusername" value="root"/>
>> <property name="org.apache.manifoldcf.dbsuperuserpassword" value="password"/>
>> <property name="org.apache.manifoldcf.database.name" value="manfold_db"/>
>> <property name="org.apache.manifoldcf.database.username" value="root"/>
>> <property name="org.apache.manifoldcf.database.password" value="password"/>
>> <property name="org.apache.manifoldcf.database.maxhandles" value="100"/>
>>
>> On running initialise.sh, the following exception is thrown:
>>
>> org.apache.manifoldcf.core.interfaces.ManifoldCFException: Error
>> getting connection: Access denied for user 'root'@'%' to database
>> 'mysql'
>> at org.apache.manifoldcf.core.database.DBInterfaceMySQL.createUserAndDatabase(DBInterfaceMySQL.java:624)
>> at org.apache.manifoldcf.core.system.ManifoldCF.createSystemDatabase(ManifoldCF.java:700)
>> at org.apache.manifoldcf.crawler.system.ManifoldCF.createSystemDatabase(ManifoldCF.java:168)
>> at org.apache.manifoldcf.crawler.InitializeAndRegister.doExecute(InitializeAndRegister.java:37)
>> at org.apache.manifoldcf.crawler.InitializeAndRegister.main(InitializeAndRegister.java:60)
>>
>> I am able to connect to the MySQL instance using a command line MySQL
>> client from the same machine using the same credentials, this rules
>> out networking and credentials related issues.
>>
>> Am not sure what I am missing with the setup, I have tried the
>> equivalent with a postgres setup, this seems to work just fine.
>>
>> Thanks,
>>
>>
>> Nigel Thomas
Re: ManifoldCF 1.0.1 MySQL setup : Error getting connection: Access
denied for user
Posted by Karl Wright <da...@gmail.com>.
Hi Nigel,
I'm not a MySQL expert, but I seem to recall there was something
interesting about the way MySQL authenticated remote connections.
There are two properties that the MySQL driver looks at:
/** MySQL server property */
public static final String mysqlServerProperty =
"org.apache.manifoldcf.mysql.server";
/** Source system name or IP */
public static final String mysqlClientProperty =
"org.apache.manifoldcf.mysql.client";
I think you may need to set both of these for the auth to succeed.
Also, make sure your MySQL server is configured to permit connections
from the source system you are trying to connect from.
Thanks,
Karl
On Fri, Nov 2, 2012 at 11:21 AM, Nigel Thomas <ni...@york.ac.uk> wrote:
> Hello,
>
> I am having some problems configuring 1.0.1 to use a MySQL database, I
> have followed steps here :
> http://manifoldcf.apache.org/release/release-1.0.1/en_US/how-to-build-and-deploy.html#Configuring+a+MySQL+database
>
> I have set the following db related properties in properties.xml:
>
> <property name="org.apache.manifoldcf.databaseimplementationclass"
> value="org.apache.manifoldcf.core.database.DBInterfaceMySQL"/>
> <property name="org.apache.manifoldcf.mysql.server"
> value="mysql.example.com"/>
> <property name="org.apache.manifoldcf.dbsuperusername" value="root"/>
> <property name="org.apache.manifoldcf.dbsuperuserpassword" value="password"/>
> <property name="org.apache.manifoldcf.database.name" value="manfold_db"/>
> <property name="org.apache.manifoldcf.database.username" value="root"/>
> <property name="org.apache.manifoldcf.database.password" value="password"/>
> <property name="org.apache.manifoldcf.database.maxhandles" value="100"/>
>
> On running initialise.sh, the following exception is thrown:
>
> org.apache.manifoldcf.core.interfaces.ManifoldCFException: Error
> getting connection: Access denied for user 'root'@'%' to database
> 'mysql'
> at org.apache.manifoldcf.core.database.DBInterfaceMySQL.createUserAndDatabase(DBInterfaceMySQL.java:624)
> at org.apache.manifoldcf.core.system.ManifoldCF.createSystemDatabase(ManifoldCF.java:700)
> at org.apache.manifoldcf.crawler.system.ManifoldCF.createSystemDatabase(ManifoldCF.java:168)
> at org.apache.manifoldcf.crawler.InitializeAndRegister.doExecute(InitializeAndRegister.java:37)
> at org.apache.manifoldcf.crawler.InitializeAndRegister.main(InitializeAndRegister.java:60)
>
> I am able to connect to the MySQL instance using a command line MySQL
> client from the same machine using the same credentials, this rules
> out networking and credentials related issues.
>
> Am not sure what I am missing with the setup, I have tried the
> equivalent with a postgres setup, this seems to work just fine.
>
> Thanks,
>
>
> Nigel Thomas