Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: Mike on May 26, 2003, 09:35:28 PM
-
I'm developing a Java servlet that uses the mySQL connector with JDBC to connect to a mySQL database running on my SME server. When the servlet attempts to create a connection, an IO exception occurs:
Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream
** BEGIN NESTED EXCEPTION **
java.io.IOException
MESSAGE: Unexpected end of input stream
STACKTRACE:
java.io.IOException: Unexpected end of input stream
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1096)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:387)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562)
at com.mysql.jdbc.Connection.(Connection.java:491)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
I read on the mySQL mailing list archives that this can occur if mySQL is configured to not accept remote connections via TCP/IP.
By default, is mySQL on SME configured to refuse remote connections? The machine that is running Tomcat and hence the servlet is inside my SME network (local).
Many thanks
-
> By default, is mySQL on SME configured to refuse remote connections?
yes, normally only xxxxx@localhost is allowed.
Install phpmyadmin (from contribs.org) and you get a WebGUI to manage
mySQL to allow remote connections or whatever you want.
hope this helps
jochen
-
What exactly has to be changed? If you mean allowing users access from other hosts, then I've already tried that but it didn't make any difference.
I am already using phpMyAdmin.
Thanks
-
When you say "remote" do you mean other hosts on the local network or hosts on the internet?
By default it looks like the firewall closes the Mysql port on the net side. Portopening contrib should take care of that if you really need to open it up.
G
-
Other hosts on the local network.
Thanks
-
Are u running 5.6 ? Have you searched the forum.
-
Mike wrote:
>
> What exactly has to be changed? If you mean allowing users
> access from other hosts, then I've already tried that but it
> didn't make any difference.
>
> I am already using phpMyAdmin.
Then when you look in the "Users" section from your phpmyadmin homepage, you should see a table with headers :
Action Host User Password Privileges
looking down the "host" column, "%" means "any host". If the user you are attempting to connect as from a LAN host isn't allowed to access from anything other than "localhost" you won't be able to connect.
You can either "Add a new User" and specify the host you'll be connecting from and assign privileges to the appropriate databases, or edit the user to allow access from any host "%" and let the firewall stop access from outside your LAN.
G
-
I already tried this, but I couldn't get a winning combination.
Thanks again
-
Yes I'm using 5.6 and yes I searched, but I couldn't find a relevant answer.
Thanks for replying.
-
See if this applies to you
http://www.e-smith.org/bboard//read.php?f=1&i=23210&t=23210
-
Oops, guess I missed that one while browsing the list of search results.
Thanks
-
If you are running SME 5.6 U4, then check your MySQL version ...
I had to upgrade to mysql-3.23.54a-3.73 because of remote connexion problems using odbc. You will need to upgrade those packages as well :
glibc-2.2.5-42.i386.rpm mysqlclient9-3.23.22-8.i386.rpm
glibc-common-2.2.5-42.i386.rpm mysql-devel-3.23.54a-3.73.i386.rpm
libpng-1.0.14-0.7x.4.i386.rpm mysql-server-3.23.54a-3.73.i386.rpm
libstdc++-2.96-113.i386.rpm
You can find them all on rpmfind.net
hope this helps
-
I see - thanks Bertrand.
-
I'm using version mysql-3.23.49-3 of mySQL.
I daren't upgrade those libraries, in case break something on the server and have to re-install. I have too many files saved on there and I'm not that brave!
Thanks
-
You could try a backup ... if you're that scared !
I did it on 4 different servers, and they were all with in production, with intranet systems running, but all of them needed to be connected through ODBC.
Everything went just fine.
These upgraded packages are from Red Hat, and as far as I know, the e-smith team are using them with no modifications.
Now it's up to you.
PS: If you can you could first try it on a non productive server.
-
Unfortunately I don't have a spare server to try it on.