Php connection to remote mysql server

Hi,
I've stragne problem using php 4.3.10 with Sun One 6.1 on Solaris 9. The connection to a remote mysql server fail. I've correct grants in both servers and the php.ini is setting to permit no limit connection to databases. the code:
$host='my-remote-server.com';
$link1=mysql_connect($host,"bla","blabla");
if$db1 = mysql_select_db("LOGIN",$link1);
$link = mysql_connect("localhost","bla","blabla");
$db = mysql_select_db("LOGIN",$link);
The remote connection fail but the local one works. When i work with another server Sun One 6 in Solaris 8 , everthing work wonderfull with the same deffinitions, it can connect the remote databases but the others machines can't connect the solaris 8 machine. i think there is something wrong in the solaris 9 or/and sun one 6.1 deffinition it avoid remote connection. The problem i don't know what may be wrong, which setting may affect tcp connections from web application in solaris 9/sun one 6.1 plataform.

we found the problem finally and may be useful for someone. Using the solaris 9 network snifer (snoop) we found that the default php timeout connection for mysql doesn't work ,this value is 60 in the php.ini . After 4 or 5 miliseconds php application closes the connection when it runs from the webserver , running from the shell it doesn't happen.The answer from the other server arrived after 20 or 30 milisecods then the connection to the databases fails. The solution is to put unlimited tiemout , mysql_connection_timeout=-1 then it success to connect the remote mysql server correctly. May be problem without timeout connection in case the other server doesn't answer, then application may wait forever or untill the system or webserver take out the application. I didn't check this posibilty, mainly i'm interesting the applications can work and write in the remote databases. If this definition cause problem as application waiting connection we always can try with another value greater than 60.

Similar Messages

  • Connecting to remote mysql server

    Hi all,
    Been having problems connecting to a remote mysql database. Everytime i run the servlet I get the following :
    Communication link failure: java.io.EOFException, underlying cause: null
    I've been google'ing for a while and it seems the usual respone is that the connection has timed out, but this happens everytime I try to connect so I don't really see how that applies to this particular problem. Here's part of he code I'm using.
    Class.forName( "org.gjt.mm.mysql.Driver").newInstance();
    Connection db = DriverManager.getConnection("jdbc:mysql://hostname/databasename", "username", "password");I'm using Tomcat 4.1.30 and mysql-connector-java-3.0.15-ga-bin.jar ( and I've also tried with mysql-connector-java-2.0.14-bin.jar). Any advice would be greatly appreciated.

    Here's the complete error message including the stack trace. Just to specify a little more:
    - SQL server is alive and running
    - Specifying IP address instead of name results in same error (Same when adding port 3306)
    - Running the servlet using tomcat 4.1.30 (http://localhost:8080/servlet/dbtest) with mysql-connector-java-3.0.15-ga-bin.jar
    - Not sure if there are any firewalls in between (There probably is one, but not on this end.) I'll try to get in touch with the server admin this week.
    java.sql.SQLException: Communication link failure: java.io.EOFException, underly
    ing cause: null
    ** BEGIN NESTED EXCEPTION **
    java.io.EOFException
    STACKTRACE:
    java.io.EOFException
            at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1394)
            at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1413)
            at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:625)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:1782)
            at com.mysql.jdbc.Connection.<init>(Connection.java:450)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :411)
            at java.sql.DriverManager.getConnection(DriverManager.java:512)
            at java.sql.DriverManager.getConnection(DriverManager.java:171)
            at dbtest.service(dbtest.java:37)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:256)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:191)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2422)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:180)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:171)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:163)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:174)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:19
    9)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :828)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ssConnection(Http11Protocol.java:700)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
    :584)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
    ool.java:683)
            at java.lang.Thread.run(Thread.java:534)
    ** END NESTED EXCEPTION **
            at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1446)
            at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:625)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:1782)
            at com.mysql.jdbc.Connection.<init>(Connection.java:450)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :411)
            at java.sql.DriverManager.getConnection(DriverManager.java:512)
            at java.sql.DriverManager.getConnection(DriverManager.java:171)
            at dbtest.service(dbtest.java:37)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:256)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:191)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2422)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:180)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:171)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:163)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:641)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:174)
            at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
    t.invokeNext(StandardPipeline.java:643)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:19
    9)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :828)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ssConnection(Http11Protocol.java:700)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
    :584)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
    ool.java:683)
            at java.lang.Thread.run(Thread.java:534)

  • MySQL System DSN: Host is not allowed to connect to this MySQL Server

    Hi all,
    I'm creating a FileMaker database to keep track of support and to-do items, for a large forum-site I'm managing here in Denmark.
    The site runs on our webhosts servers, but I have a MacMini server we use for development. I'd like to connect the MacMini's MySQL server to FileMaker, and have purchased Actuals ODBC pack witch works great. I can connect to the MySQL server on the MacMini via Navicat, by enabling an SHH Tunnel.
    When trying to create a System DSN via the Actual ODBC drivers, to connect to the MacMini, I get this error:
    Link to screenshot: http://img.skitch.com/20100104-82xe6j7x9b8cjmj357t33p9sb1.png
    The one very strange thing is, that the Mac I'm trying to connect from, is at 192.168.1.15 and not 10.0.0.5! The MacMini is at 10.0.0.2 so it makes no sense what so ever, and as I said, I can connect fine to 10.0.0.2 via Navicat, even though it only works when I enable SSH Tunneling.
    But of course the Actual ODBC (or any for that matter?!) drivers does not support creating an SSH Tunnel, so I need to be able to connect directly to the MacMini's SQL-server, but when I try I get the above error.
    Port 3306 IS open on the server, so I must be overlooking something obvious. I've tried to change the socket when setting up the System DSN to /var/mysql/mysql.sock or /var/mysql but that changes nothing.Ohh yeah, that is ignored for remote servers by the way!
    Can anyone help? How do you guys setup your System DSN to a Mac-server with Snow Leopard Server on it?
    Thank you so much in advance
    Thomas
    PS: I can connect fine to our Webhosts MySQL server with the Actual Drivers, but to decrease load on that server, I'd like to get the data for the FileMaker Support Database from our development-server instead!

    bump
    Anyone got an idea on this? If I've posted in the wrong forum, please advise, because I was a little in doubt as to where this was to be placed

  • Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

    I'm using the pre-installed versions of php and mysql under Mac OS X Server 10.4.4 running on a G4 and am unable to get anything involving mysql to work.
    I ssh to the server and enter various commands in Terminal:
    on typing "mysql" I get
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
    and on typing "mysqladmin version" I get
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/var/mysql/mysql.sock' exists!
    On typing "sudo mysqld_safe" I get
    Starting mysqld daemon with databases from /var/mysql
    STOPPING server from pid file /var/mysql/MyServer.local.pid
    070722 16:06:05 mysqld ended
    /var/mysql/MyServer.local.err contains
    070722 16:06:04 mysqld started
    070722 16:06:04 [Warning] Setting lowercase_tablenames=2 because file system for /var/mysql/ is case insensitive
    070722 16:06:04 InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    070722 16:06:05 InnoDB: Starting log scan based on checkpoint at
    InnoDB: log sequence number 0 43634.
    /var/mysql has permissions 775.
    The line
    mysql.default_socket = /var/mysql/mysql.sock
    is in /etc/php.ini
    whereis mysqladmin ->
    /usr/bin/mysqladmin
    whereis mysql ->
    /usr/bin/mysql
    ls /var/mysql ->
    MyServer.local.err
    ib_logfile1
    mysql
    ib_logfile0
    ibdata1
    test
    Can't find my.cnf or my.ini anywhere
    Can't find mysql.sock anywhere
    I'm trying to get a bug database running (mantis) under Mac OS X Server 10.4.4 that I can access from local clients.
    I'm trying to follow directions at http://www.mantisbugtracker.com/manual/manual.installation.php
    without knowing anything about mysql or php and I'm stuck on step 3:
    "Next we will create the necessary database tables and a basic configuration
    file."
    I get a message saying
    "Does administrative user have access to the database? ( Lost connection to MySQL server during query )"
    I don't even know if following the mantis directions has resulted in the creation of a database or not. Where would it be?
    Thanks for any help.
    Intel iMac   Mac OS X (10.4.10)  

    I've just done a clean install of OSX Server and added the latest MYSQL packaged installer. Afterwards I found the lock file in /private/tmp/mysql.lock
    The easiest way to solve this problem is to create a symbolic link so that the lock file appears to be in right place.
    e.g.
    cd /var
    sudo mkdir mysql <== this assumes the directory is missing
    cd mysql
    sudo ln -s /private/tmp/mysql.sock mysql.sock
    After this msql commands should work fine, and you've not fiddled with the security settings on users/groups.
    HTH
    Christian

  • How to contact remot mysql server

    hello everyone
    I am programming a java application,needing to contact remote mysql server, how should i do?
    for example:
    the mysql server ip is:192.168.0.1
    user:chengshwu
    password:123456
    what driver should i select?how should i writing the classForName() and DriverManager.getConnection
    thanks for you help

    what driver should i select?mysql driver offcourse from here
    http://servlet.java.sun.com/products/jdbc/drivers
    how should i writing the
    classForName() and DriverManager.getConnectionhere is a good tutorial which explains.
    http://java.sun.com/docs/books/tutorial/jdbc/basics/connecting.html
    thanks for you helpyou welcome

  • Applet connection to remote MySql - HELP

    Hi:
    I've got an applet that connects to a MySql database (4.1).
    As long as I try to connect to the MySql server on the machine the applet is running on (my development computer), everything works great.
    I'm using this jar as the MySql connector:
    mysql-connector-java-5.0.3-bin.jar
    I can connect to the remote MySql server (also 4.1) with MySql Administrator and also with .NET, no problem.
    BUT - when I try to connect to the remote MySql server from the Applet I get an 'access denied' error.
    I also tried it from the applet set up as a Java application with a main function. If I try to connect to the local MySql server, no problem. If I try to connect to the remote machine I get a 'connection timeout' error.
    I should add that when I connect to the remote machine from MySql Administrator, the connection is almost instantaneous and with no problem.
    Any help would be greatly appreciated.

    Well, I've been over it and over it. I've read and tried everything I could find.
    No matter what I do it won't connect.
    The applet is signed, I don't need to learn how to do that.
    The popup comes up and asks if I want to run it: I click YES
    The connection works fine for the local database but not the remote one.
    Again, I can connect to the remote one with MySql Admin just fine using the same parameters.
    import java.*;
    import java.sql.*;
    import java.util.*;
    import java.security.*;
    public class DBaseConn extends java.applet.Applet {
        private java.sql.Connection  oCn = null;   
        private final String MySqlUrl = "jdbc:mysql://555.555.555.555:3306/mysql";
        private final String MySqlserverName= "555.555.555.555";
        private final String MySqlportNumber = "3306";
        private final String MySqldatabaseName= "mysql";
        private final String MySqluserName = "SomeUser";
        private final String MySqlpassword = "SomePassword";
        private final String selectMethod = "cursor";
        public String sErr = "";
        public void init() {
            // TODO start asynchronous download of heavy resources
        public java.sql.Connection OpenMySqlDBase() throws Exception
           try
                Class.forName("com.mysql.jdbc.Driver");
                //oCn =  DriverManager.getConnection(MySqlUrl, MySqluserName, MySqlpassword);
                oCn = (Connection)AccessController.doPrivileged(new PrivilegedAction() {
                    public Object run()
                        try
                            return DriverManager.getConnection(MySqlUrl, MySqluserName, MySqlpassword);                       
                        catch(Exception exp)
                            sErr = exp.getMessage();
                            return null;
                if(oCn!=null)
                    sErr = "MySQL Connection SUCCEEDED!!";
                    return oCn;
                else
                    if(!sErr.equals(""))
                        sErr = "MySQL Connection FAILED with ERROR: " + sErr;
                    else
                    sErr = "MySQL Connection FAILED!";
                    return null;
           catch(Exception exp)
               sErr = "MySQL Connection FAILED With ERROR!:\r\n" + exp.getMessage();
               return null;
    }The error is:
    Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.net.SocketException
    MESSAGE: java.security.AccessControlException: access denied (java.net.SocketPermission 555.555.555.555:3306 connect,resolve)
    STACKTRACE:
    , , ,

  • Oracle 10.2 on AIX -- need to connect to remote SQL server by dblink

    oracle 10.2 on AIX -- need to connect to remote SQL server by dblink
    i didn't see a odbc diectory in our oracle home path. how do i know odbc driver is installed in the oracle on our AIX server.
    If it is there, do i just need to modify the odbc.ini and then the inithsodbc.ora, linster.ora, tnsnammes.ora files, or am I missing something
    Appreciate your response
    Edited by: user10876711 on May 12, 2011 9:18 AM
    Edited by: user10876711 on May 12, 2011 9:18 AM

    when you want to connect from Oracle to a SQl Server you need the Oracle Gateway (HSODBC or even better Dg4ODBC) and a FOREIGN ODBC DRIVER for your foreign database - a SQL Server ODBC driver. You have to get this driver from a 3rd party vendor - Oracle does not offer any foreign ODBC drivers.
    So before being able to use DG4ODBC/HSODBC you need to install from a 3rd paryt vendor a SQL Server ODBC driver. Commercial vendrs are for example Data Direct, Openlink or Easysoft.
    On Unix ODBC drivers commonly also require a driver manager. If the ODBC driver vendor does not ship one with the ODBC driver you can get it from www.unixodbc.org

  • "Can't connect to local MySQL server through socket '/tmp/mysql.sock'"

    Data Services=3.1
    Repository=12.2.2.0000
    Red Hat Enterprise 5
    Designer,Job Server,Job Engine=12.2.2.3
    After an unscheduled server reboot with DS up and running when trying to start a job in either Data Services Management Console or DS Designer getting the following:
    "Can't connect to local MySQL server through socket '/tmp/mysql.sock'"
    The mysql.sock have never been in /tmp and on the production server it does not exist there and the production server is up and running correctly. If a link is created to mysql.sock(/home/user/boedge31/bobje/mysql) the job will start but return this message: 
    "Cannot retrieve <Version> from the repository. Additional database information: <SQL submitted to ODBC data source <localrepo> resulted in error <MySQL ODBC 3.51 Driver mysqld-5.0.46-enterprise No database selected>. The SQL submitted is <select VERSION, SECURITYKEY, GUID from AL_VERSION where NAME = 'Repository Version'"
    I checked and AL_VERSION and the Version field exist. 
    Before the shut down DS was working correctly and had no issues.  My best guess is a part of the repository was corrupted during the unscheduled shut down.  It seems like DS has "forgotten" some of the settings.  
    Any suggestions on a possible solution?

    The issue has been solved. 
    There was a bad path in $LD_LIBRARY_PATH.
    Removed the path and DS started working again.

  • Flex mobile connect to remote secure server!!

    Hi guys
    I'm a beginner with flex mobile.
    i'm trying to create an appllication flex mobile. and i have to connect to remote secured server (apache) to get some services deployed.
    i did it and when i try with emulator from flash builderit's worked, a pop up window started to enter a login and password for connect to the remote server. it's okay, i get a result.
    but now when i try this application with my mobile phone, application launched correctly but i can't connect to remte server ( i dont have anythig like a popup to enter the login and pssword).
    i need your help.
    thanks

    Did you ever figure this out? I'm having the same issue.

  • Cannot connect java to mysql server 2000

    I was unable to connect to the mysql server 2000 with the jcreator.
    The following exception was thrown:
    java.net.SocketException
    MESSAGE: java.net.ConnectException: Connection refused: connect
    STACKTRACE:
    java.net.SocketException: java.net.ConnectException: Connection refused: connect at com.mysql.jdbs.StandardSocketFactory.connect<StandardSocketFactory.java:156?
    at com.mysql.jdbc.MysqlIO.<init><MysqlIO.java:284>
    ** END NESTED EXCEPTION **
    and the code i used was :
    package com.stardeveloper.example;
    import java.sql.*;
    public class JCustomer {
    public static void main(String args[]) {
    Connection con = null;
    try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    con = DriverManager.getConnection("jdbc:mysql:///Customer", "user", " ");
    if(!con.isClosed())
    System.out.println("Successfully connected to MySQL server...");
    } catch(Exception e) {
    System.err.println("Exception: " + e.getMessage());
    } finally {
    try {
    if(con != null)
    con.close();
    } catch(SQLException e) {}
    I donot have any user and pwd for the MYsql server, it is local host connection and window authentication is used.

    eventhough it is local ,you may need to specify dns/localhost/ip with port number.
    otherwise you can use myODBC driver which is freely available in mysql website. you can connect to the database using Data source Name, just like using any other ODBC connectivity.

  • MySQL problem -- ERROR 2002 Can't connect to local MySQL server

    Not Sure if this would be a right forum for my problem...
    I'm installing mySQL on my iBook, and thought that I have configured it. But then, after followring some instuctions from Adobe and Marc Liyanage sites, I have a problem to connect. This is what I've done in "TERMINAL"
    ~username$> cd /usr/local/mysql
    mysql ~username$> sudo chown -R mysql data/
    (asking for admin password)
    mysql ~username$> sudo echo
    mysql ~username$> sudo ./bin/mysqld_safe &
    username-ibook-g4:/usr/local/mysql username$ Starting mysqld daemon with databases from /usr/local/mysql/data
    STOPPING server from pid file /usr/local/mysql/data/roshaili-osmans-ibook-g4.local.pid
    060611 16:31:30 mysqld ended
    mysql ~username> /usr/local/mysql/bin/mysql test
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    [1]+ Done sudo ./bin/mysqld_safe
    mysql ~username>
    When I typed ::
    /usr/local/mysql/bin/mysqladmin -u root
    (see that there's no password)
    Then it displays:
    /usr/local/mysql/bin/mysqladmin Ver 8.41 Distrib 5.0.22, for apple-darwin8.6.0 on powerpc
    Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license
    Administration program for the mysqld daemon.
    Usage: /usr/local/mysql/bin/mysqladmin [OPTIONS] command command....
    -c, --count=# Number of iterations to make. This works with -i
    (--sleep) only.
    ...... bla bla bla.....
    Variables (--variable-name=value)
    and boolean options {FALSE|TRUE} Value (after reading options)
    count 0
    force FALSE
    compress FALSE
    character-sets-dir (No default value)
    default-character-set (No default value)
    host (No default value)
    port 0
    .........bla bla....
    ping Check if mysqld is alive
    processlist Show list of active threads in server
    reload Reload grant tables
    refresh Flush all tables and close and open logfiles
    shutdown Take server down
    status Gives a short status message from the server
    start-slave Start slave
    stop-slave Stop slave
    variables Prints variables available
    version Get version info from server
    roshaili-osmans-ibook-g4:~ roshailiosman$ >
    -----------------finish-----------------
    Does that mean that I'm connected to mySQL?
    Does anybody how to connect to MYSQL from the terminal? Thanks.
    iMac Mac OS X (10.4.6)
    iMac   Mac OS X (10.4.6)  

    Your biggest 'issue' right now is that your mysqld process is stopping on you -- making a connection impossible.
    Why it's bombing might be in a log .. try in mysql/data/usr.local.err .. and fix why itsbombing.
    To connect to it it'll be : mysql -u root -ppassword -D database

  • ./mysqlshow: Can't connect to local MySQL server through socket '/tmp/mysql

    hi all ,I install mysql on Solaris 10 at first it work fine , but after I restart my PC and go back again I got error on
    ./mysqlshow: Can't connect to local MySQL server through socket '/tmp/mysql
    I google , but still not sure how to deal with it
    Thank you

    I've just done a clean install of OSX Server and added the latest MYSQL packaged installer. Afterwards I found the lock file in /private/tmp/mysql.lock
    The easiest way to solve this problem is to create a symbolic link so that the lock file appears to be in right place.
    e.g.
    cd /var
    sudo mkdir mysql <== this assumes the directory is missing
    cd mysql
    sudo ln -s /private/tmp/mysql.sock mysql.sock
    After this msql commands should work fine, and you've not fiddled with the security settings on users/groups.
    HTH
    Christian

  • Flex 3 and connection to remote ubuntu server

    Good morning,
    I'm trying to retrieve the result from a SQL query to populate a datagrid.
    My server is a Ubuntu server on a virtual machine. I created the tables I want to extract information from using MySQLWorkbench and put them on my ubuntu server. Flex is running on my Mac.
    I have the following code in the mxml file of my Flex project:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="rest_service.send()">
        <mx:HTTPService id="rest_service" url="http://192.168.56.101/testhtml.php"/>
        <mx:DataGrid left="0" right="0" top="0" bottom="0"
            dataProvider="{rest_service.lastResult.people.person}">
            <mx:columns>
               <mx:DataGridColumn headerText="Test ID" dataField="userid"/>
               <mx:DataGridColumn headerText="Name" dataField="username"/>
               <mx:DataGridColumn headerText="Email" dataField="emailaddress"/> 
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>
    The testhtml.php file is on the server (in the /var/www/ folder) and looks like this:
    <?php
       require ("Connection.php");
    $db_handle = mysql_connect($server, $user_name, $password);
    $db_found = mysql_select_db($database, $db_handle);
    if ($db_found) {
    $Query = "SELECT * from users";
    $Result = mysql_query( $Query );
    //print "allo?" . "<br/>";
    echo htmlspecialchars('<?xml version="1.0" encoding="utf-8"?>')."<br/>";
    echo htmlspecialchars('<people>')."<br/>";
    //print '<people>';
    // Iterate through the rows, printing XML nodes for each
    while( $Row = mysql_fetch_object( $Result ) )
      echo "      ";
      echo htmlspecialchars('<person>') . "<br/>" ;
      echo "            ";
      echo htmlspecialchars('<userid>'.$Row->userid.'') ;
      echo htmlspecialchars('</userid>') . "<br/>";
      echo "            ";
      echo htmlspecialchars('<username>'.$Row->username.'');
      echo htmlspecialchars('</username>') . "<br/>";
      echo "            ";
      echo htmlspecialchars('<emailaddress>'.$Row->emailaddress.'');
      // echo htmlspecialchars('<emailaddress>"'.$Row->emailaddress.'"');
      echo htmlspecialchars('</emailaddress>') . "<br/>";
      echo "      ";
      echo htmlspecialchars('</person>') . "<br/>" ;
    echo htmlspecialchars('</people>');
    mysql_close($db_handle);
    else {
    print "Database NOT Found ";
    mysql_close($db_handle);
    ?>
    I tested the php file by typing http://192.168.56.101/testhtml.php in my web browser and I get the xml code expected. The problem is that I don't think Flex is actually connecting to the server.... I have noticed that when you create a new project you can select an application server type but I have no idea what to put for the web root and the root url (I picked php in the list of options for the server type).
    My server is not hosted on my machine but on a virtual machine. Is there something I need to install on my server, and if yes, on which folder?
    Your help would be greatly appreciated. I'm a newbie and have lots to learn and I have been stuck on this for a while now.
    Thank you again,
    supernous

    Forget it. I'm an idiot.
    I forgot to active the "Allow remote admin" setting again

  • PHP Connection to a MySQL database "An unidentified err has occurred"

    This is driving me up the wall.... With my hosting provider
    at work I cannot make a connection to a MySQL database with
    dreamweaver using the new connection in the databases tab. "an
    unidentified error has occurred"
    I am certain that I am entering the info correctly and have
    the correct permissions to access the database, I think it has to
    do with the _mmServerScripts folder and the testing server.
    With the hosting provider that I use for personal websites I
    make connections all day long doing the exact same thing that I am
    doing here at work and I'm stumped. I even read a lenghty article
    on this forum with possible solutions... none of them worked.
    Is there any way around the _mmServerScripts directory and
    testing server to make a connection and then use the bindings and
    server behaviors tabs to creat recordsets, etc??
    Thanks in advance for any help!
    George

    o0knightro wrote:
    > Is there any way around the _mmServerScripts directory
    and testing server to
    > make a connection and then use the bindings and server
    behaviors tabs to creat
    > recordsets, etc??
    Not if you want to use Dreamweaver server behaviors, no. The
    usual
    meaning of "an unidentified error has occurred" is failure to
    connect
    because communication is blocked by a firewall.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Access a remote mysql server

    Hi,
    Is it possible to access a mysql server which is in a remote computer other than the computer where the java programming is running. Plz tell me how to do that.
    Thanks a lot,
    Chamal.

    Yes - use the MySQL type IV JDBC driver to make a connection to any database, including remote ones. It's free to download. Do a Google search on MySQL JDBC.
    MOD

Maybe you are looking for