LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-01-2008, 08:59 AM   #1
cuk
Member
 
Registered: Jun 2004
Distribution: slackware 10.2.
Posts: 39

Rep: Reputation: 15
mysql java connector


Hello,
I use a java program which connects to mysql. When I start mysqld the recomended way:
Code:
/etc/rc.d/rc.mysqld start
the program refuses to connect, giving the following errors:
Code:
java.net.SocketException: java.net.ConnectException: Connection refused
	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:151)
	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
	at com.mysql.jdbc.Connection.createNewIO(Connection.java:1774)
	at com.mysql.jdbc.Connection.<init>(Connection.java:437)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
However, if I start mysqld simply with
Code:
su -c 'mysqld_safe&'
everything works.
It is not really a serious problem, I have been working like this for almost a year. Just curious. I use slackware 12.0, and I have uncommented SKIP='--skip-networking' in rc.mysqld. Thanks in advance for your interest.
Kind regards
 
Old 06-01-2008, 09:07 AM   #2
zhoun
Member
 
Registered: Oct 2007
Location: anywhere
Distribution: slackware64 current & win7 64 on thinkpad X61
Posts: 104

Rep: Reputation: 18
Yes, the java not support Unix socket pipe, only support tcp/udp, So you have to enable the network access to mysqld.
 
Old 06-01-2008, 09:15 AM   #3
cuk
Member
 
Registered: Jun 2004
Distribution: slackware 10.2.
Posts: 39

Original Poster
Rep: Reputation: 15
Thanks for the quick reply

but I think I have done so by uncommenting SKIP=--skip-networking in rc.mysqld.
I also tried uncommenting #skip-networking false in my.cnf, but mysqld refused to start:
Code:
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
 
Old 06-01-2008, 10:11 AM   #4
zhoun
Member
 
Registered: Oct 2007
Location: anywhere
Distribution: slackware64 current & win7 64 on thinkpad X61
Posts: 104

Rep: Reputation: 18
I think you should comment "#SKIP=--skip-networking" in rc.mysqld, not uncomment like this "SKIP=--skip-networking".
You can check the *.err file in the /var/lib/mysql directory to see what's wrong with mysql when you changed the my.cnf.
 
Old 06-01-2008, 10:48 AM   #5
cuk
Member
 
Registered: Jun 2004
Distribution: slackware 10.2.
Posts: 39

Original Poster
Rep: Reputation: 15
Thumbs up

Thanks, that did it! I don't know anymore why I commented it out in the first place, probably I thought SKIP=--skip is a double negation, thus it would enable it. Anyway, now it works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql and mysql java connector, connection refused arubin Slackware 3 03-29-2008 01:41 AM
Installing the MySQL Connector ShaqDiesel Linux - Server 14 11-14-2007 04:45 PM
JDBC connection, mysql-connector-java fhleung Programming 4 08-16-2007 12:49 AM
Java connector linuxfriend Linux - Software 1 02-10-2006 02:33 AM
Where to put mysql-connector-java folder dukehazord Linux - General 1 09-10-2004 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration