We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › MySQL Lib doesn`t work in Processing 1.0.1
Page Index Toggle Pages: 1
MySQL Lib doesn`t work in Processing 1.0.1 (Read 1024 times)
MySQL Lib doesn`t work in Processing 1.0.1
Jan 8th, 2009, 2:20am
 
Nearly all libs that I tried with Processing 1.0.1 doesn`t work anymore. When I try to connect to my SQL database, I get this error:

What`s wrong?



SQL.connect(): Could not connect to the database ( jdbc:mysql://localhost/mtIMGLibrary ).

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(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at de.bezier.data.sql.SQL.connect(Unknown Source)
at connectMySQL.setup(connectMySQL.java:54)
at processing.core.PApplet.handleDraw(PApplet.java:1383)
at processing.core.PApplet.run(PApplet.java:1311)
at java.lang.Thread.run(Thread.java:613)


** END NESTED EXCEPTION **



Last packet sent to the server was 18 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(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at de.bezier.data.sql.SQL.connect(Unknown Source)
at connectMySQL.setup(connectMySQL.java:54)
at processing.core.PApplet.handleDraw(PApplet.java:1383)
at processing.core.PApplet.run(PApplet.java:1311)
at java.lang.Thread.run(Thread.java:613)
Re: MySQL Lib doesn`t work in Processing 1.0.1
Reply #1 - Jan 8th, 2009, 5:00am
 
hi,
the error that you get indicates that the library can't connect to the mysql database, so not necessarily a library error. when trying to establish a connection, the server (your sql database) refuses to let you connect or the database socket can't be found. just some thoughts: is the database running can you successfully connect to the database via the command line did you try 127.0.0.1 instead of localhost
making a google search for mysql jdbc connection refused gives quite a few hits, too.

you say nearly all libs that you tried dont work with 1.0.1 anymore. which libraries would that be so action can be taken this would be really helpful information together with your system setup (os, java version, etc.).

best,
andreas
Re: MySQL Lib doesn`t work in Processing 1.0.1
Reply #2 - Jan 8th, 2009, 8:36am
 
the latest vesion of the library has been tested with 1.0.x and works for me:
http://bezier.de/processing/libs/sql/

as andreas already pointed out there seems to be a problem with your database or the connection to it, not with the library.

can you connect to your database normally?

F
Re: MySQL Lib doesn`t work in Processing 1.0.1
Reply #3 - Jan 8th, 2009, 5:06pm
 
Yes I can connect to my localhost database for example with PHP without any problems. I use Mac OSX, Processing 1.0.1 and SQLibrary 0.0.8. But it won`t work.
Re: MySQL Lib doesn`t work in Processing 1.0.1
Reply #4 - Mar 7th, 2009, 2:54pm
 
One thing I did to get MySQL library working in processing: I specified the port number that MySQL was operating on. Instead of "localhost" I used "localhost:8889" and I can now easily connect to my local MySQL database.

I found the MySQL port number on a MAMP control panel. I'm sure there are other ways of finding the MySQL port number.

If you can get your MySQL library working under "localhost" of course, don't bother with the port number but if you are getting nowhere with processsing/MySQL look into the port number.
Page Index Toggle Pages: 1