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)

VISHAL
  • 33
  • 1
  • 7

2 Answers2

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?

brandeded
  • 1,845
  • 8
  • 32
  • 50
  • 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
1

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

Artiya4u
  • 26
  • 1