Hello
If you can help it would be GREAT!
When I connect to MySQL from a Java test class I can connect and
execute a query. When I use exactly the same code to connect via Tomcat
I get the following stack trace:
java.sql.SQLException: Cannot connect to MySQL server on
localhost:3306. Is there a MySQL server running on the machine/port you
are trying to connect to? (java.lang.NumberFormatException)
com.mysql.jdbc.Connection.connectionInit(Unknown Source)
com.mysql.jdbc.jdbc2.Connection.connectionInit(Unknown Source)
com.mysql.jdbc.Driver.connect(Unknown Source)
java.sql.DriverManager.getConnection(DriverManager.java:512)
java.sql.DriverManager.getConnection(DriverManager.java:193)
...
What I have:
Mandriva Linux 10.2
MySQL 4.1.11
Tomcat 5.0.28 (also tried 4.1.31)
Sun JDK 1.4.2_05
I find this same error message all over the web and have tried
everything to solve the problem, but it's a no-go.
I have an idea that it may either be something to do with how my
network is setup or with how catalina is setup.
I don't think it's a permissions thing, as I can connect if I run the
java code inside EclipseIDE.... mmmm.... unless Tomcat starts up under
a user that doesn't have permissions to something. I started MySQL
without permission checking using the --skip-grant-tables flag - just
to try and make sure.
My PC has an Atmel wireless lan card installed and no other NIC's or
modems. I'm not very familiar with Linux so I am learning... this makes
me think that I have perhaps screwed something up somewhere. I have
tried connecting with localhost, 127.0.0.1 and 192.168.0.2 (my wireless
IP).
I can telnet to localhost 3306.
The mysql.sock file exists in /var/lib/mysql
Any suggestions?
Any questions?
Please....
Thanks
Paul