4 messages in com.mysql.lists.javaRe: Apache, Tomcat, MySQL, mm_mysql J...| From | Sent On | Attachments |
|---|---|---|
| Wave Communications | 15 Nov 2000 12:13 | |
| Mikel | 15 Nov 2000 12:23 | |
| Wave Communications | 15 Nov 2000 13:01 | |
| Mikel | 15 Nov 2000 13:16 |
| Subject: | Re: Apache, Tomcat, MySQL, mm_mysql JDBC driver Problems![]() |
|---|---|
| From: | Wave Communications (wave...@arrakis.es) |
| Date: | 11/15/2000 01:01:14 PM |
| List: | com.mysql.lists.java |
Mikel,
Thanks, your e-mail it helped me resolve the problem...
I used the following command to test the MySQL server user permissions. mysql -h hostname -u username -p I tried various combinations and was able to connect to the db using hostname:localhost and username:fry I then amended the URL in the Java code as follows:- "jdbc:mysql://localhost/zocodb?user=fry&password=********" and it worked first time.... I must have tried every combination except this one...
Thanks again for your help....
Mark
----- Original Message ----- From: Mikel <mik...@ocsny.com> To: Wave Communications <wave...@arrakis.es> Cc: <ja...@lists.mysql.com> Sent: 15 November 2000 20:23 Subject: Re: Apache, Tomcat, MySQL, mm_mysql JDBC driver Problems
Is it possible that there error is caused by the use of the netbios name and say not the machines IP? I'm not much into java, so forgive me on this, but are apache and myswl running on the same machine? If so substitute localhost for fry and give it a try. If they are not then your problem may be permissions related, does fry have permission to access the DB server...
hope that helps, good luck...
Cheers, mikel
On Wed, 15 Nov 2000, Wave Communications wrote:
Help,
I have been tearing my hair out for the past few days trying to get a JSP to connect to a MySQL database using the mm_mysql JDBC driver. The Apache and Tomcat installation works fine with normal JSP's and
servlets on http://fry:8080/examples/pagename.jsp or http://fry:8080/zoco/pagename.jsp. MySQL also works fine in isolation.
The simple code I am using is pasted below. I have tried different
URL's but none of them will establish a connection with the db. The page loads and sits waiting for a reply until it eventually times out. I cannot see any evidence of a connection being requested from within MySQL either. I suspect the problem lies with the JDBC driver URL or the MySQL config. however I can't spot it.
I have enclosed as much info. as possible regarding the installation and
configuration of each component in hope that somebody may be able to spot the problem.
Thanks in advance,
Mark A Jenkins Software Developer
JSP Code
<%@ page language="java" import="java.sql.*" %> <%Class.forName("org.gjt.mm.mysql.Driver").newInstance(); Connection myConn = DriverManager.getConnection("jdbc:mysql:///zocodb");%>
Environment/installation info.
Windows 98 -> Computer Name: fry Workgroup: futurama Computer Desc: fr...@futurama.com
JDK installed into "I:\Program Files\jdk1.3"
Apache v1.3 installed into "I:\Program Files\Apache Group\Apache" Config. ServerName fry added to httpd.conf Include "I:/Program Files/Apache Group/jakarta-tomcat/conf/tomcat-apache.conf" added to httpd.conf ApacheModuleJServ.dll installed into "I:\Program Files\Apache Group\Apache\modules"
Tomcat v3.1 installed into "I:\Program Files\Apache Group\jakarta-tomcat" Config.
- The following lines were added to autoexec.bat:- SET CLASSPATH=I:\Program Files\jdk1.3\lib\tools.jar SET ANT_HOME=I:\Program Files\Apache Group\jakarta-tomcat SET TOMCAT_HOME=I:\Program Files\Apache Group\jakarta-tomcat
- LoadModule jserv_module modules/ApacheModuleJServ.dll added to tomcat-apache.conf
- A new directory was created "I:\Program Files\Apache Group\jakarta-tomcat\webapps\zoco" The following lines were added to server.xml <Context path="/zoco" docBase="webapps/zoco" debug="9" reloadable="true" > </Context> A new zoco/WEB-INF directory was created "I:\Program Files\Apache Group\jakarta-tomcat\webapps\zoco\WEB-INF" A web.xml file was placed in zoco/WEB-INF conrtaining:- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"> <web-app> </web-app>
MySQL v3.23.22-beta installed into I:\Program Files\MySQL Info from MySQLAdmin:
Environment Local Host Name:FRY Local Username:fry Host info:localhost via TCP/IP
my.ini setup [WinMySQLAdmin] Server=I:/PROGRAM FILES/MYSQL/bin/mysqld-opt.exe user=fry password=********
[mysqld] basedir=I:/PROGRAM FILES/MYSQL #bind-address=192.168.0.98 datadir=I:/PROGRAM FILES/MYSQL/data #language=I:/PROGRAM FILES/MYSQL/share/your language directory #slow query log#= #tmpdir#= #port=3306 #set-variable=key_buffer=16M
Process PID:1 USER:fry HOST:localhost COMMAND:Processlist
Databases (FRY:192........) zocodb:accomodation
mm.mysql-2.0.2-bin installed in "I:\Program Files\Apache Group\jakarta-tomcat\lib" - The following line was added to the tomcat.bat file:- set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\mm.mysql-2.0.2-bin.jar
--------------------------------------------------------------------- Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before posting. To request this thread, e-mail java...@lists.mysql.com
To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java...@lists.mysql.com instead.




