10 Replies Latest reply on Jul 2, 2009 8:33 AM by stigtheghost

    Connection refused - mysql 5

    liquidbook
      I have been trying to connect Flex 3 to a mysql data service on my localhost (development machine). I am using the create application from database -> new connection profile. I keep getting a connection refused. is it a driver issue? or local security issue? mysql data service connect works well in cs3 dreamweaver (connection tested). I also tried adding a new jar from mysql (mysql-connector-java-5.0.8-bin.jar) and then configuring it in the flex preferences under connectivity.
      Host URL: is localhost. Does anyone have any insight into this issue.

      main message is:
      java.net.SocketException
      MESSAGE: java.net.ConnectException: Connection refused
        • 1. Connection refused - mysql 5
          liquidbook Level 1
          I found the problem and solved it. I was using MAMP Pro. Under Server -> Mysql I needed to uncheck "allow local access only" even though it's local (also this may be unsafe for some users). side-note I also put the jdbc driver ( mysql-connector-java-5.0.8-bin.jar ) in the Library->Java -> extensions folder. CS3 Dreamweaver does not depend on Java to make the connect, where flex (a java application) needs the jdbc driver to make the connection.
          • 2. Re: Connection refused - mysql 5
            levancho Level 3
            and how all these are related to flex?
            • 3. Re: Connection refused - mysql 5
              Sylon104
              I'm having the same issues. As for the answer post by liquidbook, I'm still confused. Could you be a little more specific? The folders you mentioned? what application and where do I find it because as it stands now i have no idea what folder or specification you are mentioning. I tried to find the "allow local access only" option. Is that an option on MAMP? FLEX? System preferences? and as for eh Library > Java? Again what application? If you could clarify this for me that would be great because I am extremely frustrated as to why this is not working.


              • 4. Re: Connection refused - mysql 5
                liquidbook Level 1
                My testing server configuration, mostly provided by MAMP Pro, a Mysql/PHP server (which is an application). In the mamp application under Server -> Mysql (no a folder but tabs) there is a checkbox option called "allow local access only". In my case I needed to uncheck the option.

                If you have the some type of problem but your not using MAMP, try looking at the configuration for your database service (mysql for me) there may be an option that is causing the connection failure. Flex was not the issue but rather it was Java was, because Flex (I believe) is using it for its data connection. There most be some security option that blocks Java from making the connection to the database service (Mysql)
                • 5. Re: Connection refused - mysql 5
                  liquidbook Level 1
                  quote:

                  Originally posted by: levancho
                  and how all these are related to flex?


                  Yes and no. See posted reply to Sylon104.

                  • 6. Re: Connection refused - mysql 5
                    Lewags
                    HI all,

                    I'm having the same problem but I'm using MAMP, not the Pro version. Where would I then find the "allow local access only" option?

                    Best regards,
                    Romano
                    • 7. Re: Connection refused - mysql 5
                      Lewags Level 1
                      Hi again,

                      I've switched off skip-networking in the my.cnf but this doesn't help, still not possible to connect to mysql from the data wizard in flex. When using localhost as host-url it says in the details:

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

                      ** BEGIN NESTED EXCEPTION **

                      java.net.SocketException
                      MESSAGE: java.net.ConnectException: Connection refused

                      Any ideas?!

                      • 8. Re: Connection refused - mysql 5
                        connect2vishal
                        does anyone have any idea y m facing this probs.......
                        thanx in advance.........


                        java.sql.SQLException: Unknown database '3306'
                        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
                        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
                        at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3649)
                        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1176)
                        at com.mysql.jdbc.Connection.createNewIO(Connection.java:2558)
                        at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
                        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
                        at org.eclipse.datatools.connectivity.db.generic.JDBCConnection.createConnection(JDBCConnect ion.java:87)
                        at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverCo nnectionBase.java:104)
                        at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:53 )
                        at org.eclipse.datatools.connectivity.db.generic.JDBCConnectionFactory.createConnection(JDBC ConnectionFactory.java:52)
                        at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(Co nnectionFactoryProvider.java:77)
                        at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(Connection Profile.java:354)
                        at com.adobe.datatools.derived.wizards.BaseConnectionProfilePage.testConnectionSimple(BaseCo nnectionProfilePage.java:70)
                        at com.adobe.datatools.derived.wizards.BaseConnectionProfilePage.testConnection(BaseConnecti onProfilePage.java:51)
                        at org.eclipse.datatools.connectivity.ui.wizards.ConnectionProfileDetailsPage$1.widgetSelect ed(ConnectionProfileDetailsPage.java:85)
                        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
                        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
                        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
                        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
                        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
                        at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
                        at org.eclipse.jface.window.Window.open(Window.java:796)
                        at org.eclipse.datatools.connectivity.ui.actions.AddProfileViewAction.run(AddProfileViewActi on.java:102)
                        at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
                        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionI tem.java:546)
                        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
                        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java :402)
                        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
                        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
                        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
                        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
                        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
                        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
                        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
                        at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
                        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
                        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
                        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
                        at com.adobe.flexbuilder.standalone.FlexBuilderApplication.start(FlexBuilderApplication.java :112)
                        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
                        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:106)
                        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:76)
                        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
                        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                        at java.lang.reflect.Method.invoke(Unknown Source)
                        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
                        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
                        at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
                        at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
                        • 9. Re: Connection refused - mysql 5
                          connect2vishal Level 1
                          ok i myself figured it out instead of database i was inserting port no.

                          oops......... !!!!!!!!!! sorry...............
                          • 10. Re: Connection refused - mysql 5
                            stigtheghost

                            i fixed my problem I was about to jump to my Old hp where it was working

                            well i have a Mac so im using MAMP the ports in the MAMP are set to 8888 or MAMP ports you need to set them to Default Apache and MySQL ports

                            80 3306