0

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)

  • 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
1

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

  • thanks for the replay. i created different user it started working. – VISHAL Jul 26 '11 at 11:48
1

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?

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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