Just my 2 cents

Mysql does authentification not based on username:password
but based on [EMAIL PROTECTED]:password
Possible the selected user is allowed only for localhost
or, even better, that mysql does not listen on any interface
other than localhost (default configuration for security reasons)


rahul a écrit :

>Hi Steve,
>
>Yes the database myDB exists on the remote server, 
>at the same prot number, with the same username and password,
>
>And there is no known IP address filters (unless there is some 
>provision in default settings of mysql server)
>
>
>  
>
>>-----Original Message-----
>>From: Steve Kirk [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, October 26, 2005 6:31 PM
>>To: 'Tomcat Users List'
>>Subject: RE: problem in getting database connection from remote machine
>>using JNDI
>>
>>
>>at the risk af asking the obvious, does the database "myDB" exist on the
>>remote server at the same port number, and with the same username 
>>and pw as
>>on the local server, and if so, does it have any IP address filters that
>>forbid remote mysql client connections?
>>
>>    
>>
>>>-----Original Message-----
>>>From: rahul [mailto:[EMAIL PROTECTED] 
>>>Sent: Monday 24 October 2005 15:26
>>>To: Tomcat Users List
>>>Subject: problem in getting database connection from remote 
>>>machine using JNDI
>>>
>>>
>>>Hi all,
>>>
>>>I am using tomcat JNDI for getting databse connection in my 
>>>application
>>>
>>>For this I have created a context.xml file in myAPP/META-INF
>>>which looks like this:
>>>
>>><?xml version="1.0" encoding="UTF-8"?>
>>><Context path="/myAPP" docBase="myAPP" debug="5" reloadable="true"
>>> privileged="true" crossContext="true">
>>> <Resource name="jdbc/myAPP" auth="Container"
>>>  type="javax.sql.DataSource" maxActive="30" maxIdle="10" 
>>>maxWait="6000"
>>>  username="user" password="password"
>>>  driverClassName="com.mysql.jdbc.Driver"
>>>  url="jdbc:mysql://localhost:3306/myDB" removeAbandoned="true"
>>>  autoReconnect="true"
>>>  validationQuery="select now()"
>>>  factory="org.apache.commons.dbcp.BasicDataSourceFactory"/>
>>></Context>
>>>
>>>
>>>This works absolutely fine. But when I try to connect to a 
>>>remote database
>>>by changing url in above
>>>file to "jdbc:mysql://192.168.5.65:3306/myDB" my application fails
>>>It creates following exception while retrieving a connection:
>>>org.apache.tomcat.dbcp.dbcp.SQLNestedException:
>>>Cannot create PoolableConnectionFactory (Unknown database 'myDB')
>>>
>>>
>>>code I have written for fetching connection is:
>>>
>>>
>>>   Context ctx = (Context) new InitialContext()
>>>     .lookup("java:comp/env");
>>>   if (ctx == null)
>>>   {
>>>    throw new Exception("No context available");
>>>   } else
>>>   {
>>>    dataSource = (DataSource) ctx.lookup("jdbc/icontact");
>>>    Connection connection = dataSource.getConnection();
>>>   }
>>>
>>>
>>>can anybody help?
>>>
>>>
>>>thanks in advance
>>>--RahulJoshi
>>>
>>>
>>>
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>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