This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 208874 - Mysql connection fails using an unixdomainsocket
Summary: Mysql connection fails using an unixdomainsocket
Status: RESOLVED INVALID
Alias: None
Product: db
Classification: Unclassified
Component: MySQL (show other bugs)
Version: 7.1
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
: 209109 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-27 09:05 UTC by gery51
Modified: 2012-04-14 10:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
used Jdbc mysql driver (29.53 KB, image/png)
2012-02-27 09:16 UTC, gery51
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gery51 2012-02-27 09:05:50 UTC
Product Version = NetBeans IDE 7.1 (Build 201112071828)
Operating System = Mac OS X version 10.6.8 running on x86_64
Java; VM; Vendor = 1.6.0_29
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.4-b02-402

Hi Guys,
I' working with a mac-mini mac osx 10.6.8
The mysql server system on mac osx cannot work localy with internet addres //local:3306 it has to communicate with a mysql socket.The socket for zend server is located at /usr/local/mysql/tmp/mysql.sock.
I have downloaded and register the latest driver from the mysql site.
This driver mysql-connector-java-5.1.6.jar has a socketfactory: com.mysql.jdbc.StandardSocketFactory.
When i  custumize the driver i tried to put com.mysql.jdbc.StandardSocketFactory in the driver Class field,
when i click to find, the driver Class turn back to com.mysql.jdbc.Driver without the StandardSocketFactory 
class.
 
Schermafbeelding 2012-02-27 om 09.57.44.png


What is the problem ?

Thanks for answering,
Gerard Coppejans
Comment 1 gery51 2012-02-27 09:16:09 UTC
Created attachment 116122 [details]
used Jdbc mysql driver
Comment 2 matthias42 2012-04-14 10:27:08 UTC
This:

http://superuser.com/questions/304932/joomla-cannot-connect-to-mysql-using-localhost

sounds like your problem - use the IP address for localhost: 127.0.0.1

I seriously doubt that locally listening network services are impossible on Mac OS X. Please provide some pointers where this is documented.

If you can change the server configuration - make sure to remove:

skip-networking

is NOT in there (it disables networking)

and add

bind-address            = 127.0.0.1

this will let your mysql server listen on a local tcp socket (not reachable from another machine and so equally secure as the unixdomain variant).

Then try this jdbcurl:

jdbc:mysql://127.0.0.1:3306/mysql

and connect as root.

If you can't change the config try this:

1. Install socat (See: http://stackoverflow.com/questions/2149564/redirecting-tcp-traffic-to-a-unix-domain-socket-under-linux)
2. socat TCP-LISTEN:3306,reuseaddr,fork UNIX-CLIENT:/usr/local/mysql/tmp/mysql.sock
3. Try to connect with the jdbcurl above (it works on linux)

But beware this might expose the server on any interface (I did not check whether it binds to 127.0.0.1 or 0.0.0.0).

If you want a real solution please file a bug against connectorj/mysql to directly support unix domain sockets. The way described in bug #209109 looks like an ugly hack.
Comment 3 matthias42 2012-04-14 10:28:23 UTC
*** Bug 209109 has been marked as a duplicate of this bug. ***