Uh - if I try:

./mysql -u myname -ppasswd -h machineB.com

that gives me the error:

Access denied for user "machineA.com" 
(machine A is where I have telnetted into [from MachineB]
... and is also where the database is located - this is in line 
with the manual which states:

"If mysql -u root test works but mysql -h your_hostname -u root 
results in Access denied (where your_hostname is the 
**actual hostname of the local host***),

But I am trying to test the connection from machineB ??

Thanks
Derek

>>> [EMAIL PROTECTED] 2005/07/13 02:36:21 PM >>>
Derek Hohls wrote:
> Upayavira
> 
> Thanks for the heads-up.
> 
> I have now tried using the machine name as well... but with no
> success.
> 
> Re the second approach - this is not clear to me.  I would normally
> telnet into the box, then run ./mysql -u myname -p to work with
> sql.  However, my understanding is that when I do this I am 
> essentially connecting to mysql from the localhost.  How do I connect
> from the remote machine to the database server using the mysql 
> command as you suggest?

er, ./mysql -u myname -ppasswd -h hostname

:-)

Regards, Upayavira

> 
>>>>[EMAIL PROTECTED] 2005/07/13 01:22:06 PM >>>
> 
> Could be that you need to grant authorisation by machine name not by IP. 
> I've had struggles with that sort of thing before.
> 
> Best to debug this by trying to login to remote host just using the 
> mysql command at the command line. Then, once you've got that working, 
> you can scale up to doing it with Cocoon.
> 
> Regards, Upayavira
> 
> Derek Hohls wrote:
> 
>>I am struggling with getting a new server to communicate with a mySQL 
>>database on another machine.
>>
>>The database and queries work fine, when running on machine A, where the 
>>database is installed,
>>as does the Cocoon application when running there.  
>>
>>However, when I try and emulate the Cocoon application on machine B 
>>(same OS, same Cocoon version - Linux, C2.1.6),
>> I get a null pointer exception that I cannot seem to solve.
>>
>>Here is what I have done.
>>
>>1. Copied the mysql-connector-java-3.1.7-bin.jar file to 
>>tomcat\webapps\cocoon\WEB-INF\lib\
>>
>>2. Added an entry in web.xml for "com.mysql.jdbc.Driver"
>>
>>3. Aded an entry in the cocoon.xconf for:
>>
>>      <jdbc name="mydb">
>>              <pool-controller min="1" max="50"/>
>>              <auto-commit>true</auto-commit>
>>              <dburl>jdbc:mysql://dbserver.alias.com/mydbname</dburl>
>>              <user>myuser</user>
>>              <password>mypassword</password>
>>      </jdbc>
>>
>>4. Restarted Cocoon
>>
>>5. Added a "myuser" entry to the mySQL user table on the database machine, 
>>with 
>>
>>USE mysql;
>>GRANT USAGE ON *.* to myuser@"99.99.99.99" IDENTIFIED BY 'mypassword';
>>GRANT SELECT ON mydbname.* to ffpreporter@"99.99.99.99";
>>
>>(obviously I am using the actual IP address of Machine B)
>>
>>6.  The pipeline in question looks like:
>>
>><map:match pattern="testproject">
>>    <map:generate src="sql.xml"/>
>>    <!-- === SQL Connector ====  -->      
>>    <map:transform type="sql">
>>      <map:parameter name="use-connection" value="mydb"/>
>>      <map:parameter name="show-nr-of-rows" value="true"/> 
>>      <map:parameter name="clob-encoding" value="UTF-8"/> 
>>    </map:transform> 
>>    <map:serialize type="xml"/>
>></map:match>        
>>
>>7.  the SQL file contains:
>>
>><?xml version="1.0" encoding="UTF-8" ?> 
>><sq2:execute-query xmlns:sq2="http://apache.org/cocoon/SQL/2.0";>
>> <sq2:query name="themes">
>>  SELECT DISTINCT * FROM mytable
>> </sq2:query>
>></sq2:execute-query>
>>
>>8.  The stacktrace from Cocoon is a java.lang.NullPointerException;
>>looking in the error.log reveals:
>>
>>ERROR   (2005-07-13) 12:40.11:694   [sitemap.transformer.sql] 
>>(/cocoon/myapp/testproject) http-8080-Processor4/SQLTransformer.Query: Caught 
>>a SQLException
>>java.sql.SQLException: Failed to obtain connection. Made 5 attempts with 
>>5000ms interval
>>
>>
>>How do I go about trying to pin down why this is happening?
>>
>>Thanks
>>Derek
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED] 
>>For additional commands, e-mail: [EMAIL PROTECTED] 
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to