SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Original Poster
Rep:
I would appreciate that test program if it's not too much trouble (mailto:trona@ameritech.net) and thank you for the offer.
I have installed JDK (from the extra directory) and moved the connector from my classes directory (and removed CLASSPATH from the environment). Within OpenOffice I've pointed the "Class Path" to /usr/lib/java/lib/ext (the driver loads with just that) as well as to /usr/lib/java/lib/ext/mysql-connector...jar (and the driver loads). Also tried a space, "localhost" and the actual address of the machine for the URL setting and everything reports a communications link failure. I'm sort of at a loss and it'd be nice to try something to determine if it's an OpenOffice thing and a Java thing (I already know I can get at that data base because I can do so with the ODBC drivers). I've also fiddled with /etc/my.cnf, enabling and disabling the skip-networking directive and that hasn't mattered, either (unless there's something goofy about the pretty much default settings in my.cnf). Ah, well.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Original Poster
Rep:
OK, I've tried the source with mysql-connector 3.1.14, 5.0.8 and 5.1.7 (that's the recommended one at Sun's web site), compiling Mysqltest.class with javac Mysqltest.java for each (I saved the source as Mysqltest.java; think that's the right way to do it). Currently, mysql-connector-java-3.1.14-bin.jar is the installed version at /usr/lib/java/lib/ext and, when I run the program it kicks out all this stuff (which, I assume, means I haven't got something set correctly somewhere or other -- arrgghh!):
Code:
java Mysqltest gnis myuserid mypassword
jdbc:mysql://localhost/gnis?user=myuserid&password=mypassword
Error -- com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused
STACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection refused
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2569)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Mysqltest.main(Mysqltest.java:17)
** END NESTED EXCEPTION **
Last packet sent to the server was 17 ms ago.
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused
STACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection refused
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2569)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Mysqltest.main(Mysqltest.java:17)
** END NESTED EXCEPTION **
Last packet sent to the server was 17 ms ago.
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2643)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Mysqltest.main(Mysqltest.java:17)
# Before you can run MySQL, you must have a database. To install an initial
# database, do this as root:
#
# mysql_install_db --user=mysql
#
# Note that the mysql user must exist in /etc/passwd, and the created files
# will be owned by this dedicated user. This is important, or else mysql
# (which runs as user "mysql") will not be able to write to the database
# later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').
#
# To increase system security, consider using "mysql_secure_installation"
# as well. For more information on this tool, please read:
# man mysql_secure_installation
# To allow outside connections to the database comment out the next line.
# If you don't need incoming network connections, then leave the line
# uncommented to improve system security.
#SKIP="--skip-networking"
make sure SKIP="--skip-networking" is commented out.
Restart mysql
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Original Poster
Rep:
Well, well, well. Another gotcha. I usually control MySQL with /etc/my.cnf, which, of course, has --skip-networking commented out (and /etc/my.cnf is supposed to override what happens when MySQL starts).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.