2011-11-11 6 views
1

저는 Mac OSx 10.6을 사용하며 MySql db와 함께 Tomcat 7 서버를 사용하려고합니다. 내의 context.xml 파일 :MySql이 포함 된 Tomcat 7

<?xml version='1.0' encoding='utf-8'?> 
<Context> 

    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" 
      factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" 
      maxActive="100" maxIdle="30" maxWait="10000" 
      username="javauser" password="javadude" driverClassName="com.mysql.jdbc.Driver" 
      url="jdbc:mysql://localhost:3306/javatest"/> 
</Context> 

그리고 내 배포 설명 :

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID" version="2.4"> 
    <display-name>Love Finder</display-name> 
    <servlet> 
    <servlet-name>customer</servlet-name> 
    <servlet-class>com.neya.love.finder.pl.CustomerServlet</servlet-class> 
    </servlet> 
    <servlet-mapping> 
    <servlet-name>customer</servlet-name> 
    <url-pattern>/customer.do</url-pattern> 
    </servlet-mapping> 

    <welcome-file-list> 
     <welcome-file>index.jsp</welcome-file> 
    </welcome-file-list> 
    <resource-ref> 
     <description>DB Connection</description> 
     <res-ref-name>jdbc/TestDB</res-ref-name> 
     <res-type>javax.sql.DataSource</res-type> 
     <res-auth>Container</res-auth> 
    </resource-ref> 
</web-app> 

나는 테이블 javatest을 가지고 있지만 메이크업 연결이 dB로 때이 예외가 :

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (null, message from server: "Host '192.168.0.100' is not allowed to connect to this MySQL server") 

수있는 사람의 도움을 나를?

답변

1
당신은 당신의 MySQL의 설정 파일 (의 my.ini)에 다음과 같은 항목이 있는지 확인하시기 바랍니다

: 당신은 해당 서버에 권한을 부여 할 것

#Don't allow connections via TCP/IP. 
skip-networking 
+0

없음 스킵 네트워킹 댓글되지 –

1

컴퓨터에 MySQL의 클라이언트를 사용하여 연결할 수 있습니까?

쉘 타입에서

mysql -ujavauser -p 

그렇지 않은 경우 다음 아마도 올바른 duffymo.

+0

네, 새로운 예외가 지금 이런 식으로 –

+0

당신은 내가 모두 rigths을 부여 127.0.0.1과 192.168.0.100 – Jaydee

+0

모두에서 연결에 권한을 부여했는지 확인을 연결하지만 : 를' PoolableConnectionFactory를 만들 수 없습니다 (사용자 'javauser'@'192.168.0.100'에 대한 액세스가 거부되었습니다 (비밀번호 : 예))' –