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 & HelpIntegration › SQLibrary connection errors
Page Index Toggle Pages: 1
SQLibrary connection errors (Read 1182 times)
SQLibrary connection errors
Apr 28th, 2010, 3:57pm
 
Hi i am trying to connect to MySql trough Processing with :
bezier.de/processing/libs/sql/
(this is my first post and i guess for spam reasons i can't make this a proper link, apologies)

So far i have been very unsuccessful, i keep getting this error:

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

com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException


I 'downsized' my code to the 'basics' to get a connection working in an attempt to track the error.

Code:

import de.bezier.data.sql.*;

// created 2005-05-10 by fjenett
// updated fjenett 20080605


MySQL dbconnection;


void setup()
{
size( 100, 100 );

// this example assumes that you are running the
// mysql server locally (on "localhost").
//

// replace --username--, --password-- with your mysql-account.
//
String user = "root";
String pass = "******";

// name of the database to use
//
String database = "visual_output";

// connect to database of server "localhost"
//
dbconnection = new MySQL( this, "localhost", database, user, pass );

if ( dbconnection.connect() )
{
//query etc
}
else
{
// connection failed !
println("fail");
}
}




I am kinda lost atm, anyone ideas?
Re: SQLibrary connection errors
Reply #1 - Apr 29th, 2010, 2:55am
 
Ok, apparently i was searching on results from only a week.
The funny thing is, others had done this before as wel...

Anyway the solution to my or this problem is to specify the port of the localhost

in this case with mamp its localhost:8889

there fixed!
Page Index Toggle Pages: 1