Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am facing problem in connecting to mysql running on remote machine from the jboss,

Environment setup:

 1. Linux machines 
    (Jboss) node1:192.168.1.12 
    (mysql) node2:172.18.0.1

i have jboss running on node1 and mysql running on node2. i want to connect to mysql from jboss. i have modified mysql-ds.xml modified as follows:

<local-tx-datasource>

<jndi-name>jdbc/ser</jndi-name>
<use-java-context>false</use-java-context>
<connection-url>jdbc:mysql://172.18.0.1:3306/roulette?zeroDateTimeBehavior=convertToNull</connection-url>

<driver-class>com.mysql.jdbc.Driver</driver-class>

<user-name>root</user-name>

<password>1234</password>

<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>

<metadata>

<type-mapping>mySQL</type-mapping>

</metadata>

</local-tx-datasource>

and i have added the entry in my /etc/hosts file in node2 to give access to node1 which is as follows:

 127.0.0.1     localhost 
 127.0.1.1     vishal
 192.168.1.12  node1

 # The following lines are desirable for IPv6 capable hosts
 ::1     ip6-localhost ip6-loopback
 fe00::0 ip6-localnet
 ff00::0 ip6-mcastprefix
 ff02::1 ip6-allnodes
 ff02::2 ip6-allrouters

when i start my jboss it gives error: java.sql.SQLException:access denied for user root@yadnesh-AOA150.loacl (using password: YES)

share|improve this question
    
And what, prey tell, might the problem actually be? –  womble Jul 25 '11 at 8:47
    
@womble:sir i didn't got your point?. what you expecting ? –  VISHAL Jul 25 '11 at 9:35
1  
A description of the problem you're having, which you appear to have now added at the bottom of your question. –  womble Jul 25 '11 at 22:16
add comment

2 Answers

up vote 1 down vote accepted

Your MySql Server is not setup for accept connection from remote host with user "root". Could you try another user?

share|improve this answer
    
thanks for the replay. i created different user it started working. –  VISHAL Jul 26 '11 at 11:48
add comment

Do you have network connectivity? Through the stack / can you connect using telnet to the port mysqld is bound on the target from the source? Can you connect using a command line tool to test SQL connectivity into a database?

share|improve this answer
1  
check database connectivity first, hosts file not needed as you're using the IP address in mysql-ds.xml anyway - check 3306 is permitted by iptables/SELinux on the database server –  BoyMars Jul 25 '11 at 11:18
    
thanks for the replay –  VISHAL Jul 26 '11 at 11:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.