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 › Problem connecting with MySQL
Page Index Toggle Pages: 1
Problem connecting with MySQL (Read 841 times)
Problem connecting with MySQL
Jun 5th, 2008, 9:26pm
 
I'm having a problem to connect to mysql database, using the de.bezier.mysql library. Here is what i've tried yet.

- Installed the MAMP (only MAMP, not MAMP PRO)
- Installed the de.bezier.mysql library
- Copied the mysql-connector-java-3.1.14-bin.jar to the same directory as mysql.jar
- Copied the de.bezier.mysql example from the site
- Replaced the variables with username, password and database (test)

With this, i've got the following error:

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

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)
======================================

I've read that I should try using mysql -r <USERNAME> -p to test the connection, but when I do this, i get the following error:

-bash: mysql: command not found

I'm afraid that mysql is not working properly. If i change from localhost, to anything, i've got thesame error. What could be happening?

Re: Problem connecting with MySQL
Reply #1 - Jun 5th, 2008, 10:10pm
 
as you already figured yourself it's a problem with your MySQL setup. i'm afraid this is the wrong place to ask for help with that ... i see the mamp site has a forum as well, why not ask there first?

best
F
Re: Problem connecting with MySQL
Reply #2 - Jun 5th, 2008, 10:57pm
 
Ok, thanks for the suggestion, but I didn't found any help there too, so, I will post the solution i've found by myself. I've tried using the port at the server name and it worked fine.

At the example found at the site, it would be like this:

msql = new MySQL( "localhost:8889", database, user, pass, this );

Using the port 8889, that is the default MAMP port.
Re: Problem connecting with MySQL
Reply #3 - Jun 5th, 2008, 11:37pm
 
super, perfect. thanks for sharing!

F
Re: Problem connecting with MySQL
Reply #4 - Oct 6th, 2008, 10:55am
 
Hi Everyone, I'm trying to do the same thing, anyone find the solution for using the MAMP install?

I'll add, that i did get the mysql library to work by installing mysql from scratch and then using the built in version of Apache that ships with OSX. I think the MAMP problem is somewhere in the linking to the mysql socket that the  de.bezier.mysql.*; library is looking for??

- but i'm not sure. any info would be great.

_J
Page Index Toggle Pages: 1