Results 1 to 6 of 6

Thread: Can't connect to MySQL server on 'server' (111)

  1. #1
    duncanc is offline Member
    Join Date
    Mar 2009
    Location
    New York
    Posts
    5

    Default Can't connect to MySQL server on 'server' (111)

    Hi,

    Successfully installed SugarCRM CE 5.2.0a on Ubuntu Linux 8.10 64-bit Workstation to use the Ubuntu v8.10 supplied MySQL and Apache2. Everything installed and worked great for the last week (once i set the permissions correctly during install).

    Today, Network Manager, which manages the network connections on Ubuntu Workstation, spat the dummy and there was no connectivity.

    The Firefox browser delivered page not found errors for everything except for the SugarCRM page (which runs on the same box as the browser). Sugar returned this message instead:

    Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2003): Can't connect to MySQL server on 'server' (111) in /var/www/Sugar/include/database/MysqliManager.php on line 294

    Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /var/www/Sugar/include/database/DBManager.php on line 1621
    Could not connect to server server as root. port . Can't connect to MySQL server on 'server' (111)


    I fixed the connectivity, down to the same ip address, netmask etc, and we have connectivity, everything is working again, except for SugarCRM, which still returns the same message.

    The server has been rebooted and is clean.

    I know little about MySQL and PHP.

    Can anyone suggest a place i can start looking for the problem?

    Many thanks

    Duncan

  2. #2
    crmsiva's Avatar
    crmsiva is offline A Sugar Hero
    Join Date
    Jan 2009
    Location
    Chennai, India
    Posts
    1,128

    Default Re: Can't connect to MySQL server on 'server' (111)

    Make sure the config.php of your sugar instance have the correct details for dbconfig array.

    Also check

    http://ubuntuforums.org/showthread.php?t=12524

  3. #3
    sanjaykatiyar1's Avatar
    sanjaykatiyar1 is offline Sugar Community Member
    Join Date
    Feb 2006
    Location
    Bangalore
    Posts
    599

    Default Re: Can't connect to MySQL server on 'server' (111)

    Try to connect mysql server from the command:

    $ mysql -u <username> -p<password> -h <hostname> <databasename>

    Replace these values as you have in sugar config file for database arrary.
    Sanjay Katiyar
    iPhone and Android solutions http://www.apptility.com

  4. #4
    duncanc is offline Member
    Join Date
    Mar 2009
    Location
    New York
    Posts
    5

    Default Re: Can't connect to MySQL server on 'server' (111)

    Thanks Siva and Sanjay.

    The solution was buried in the other thread: http://ubuntuforums.org/showthread.php?t=12524

    Since I knew that the MySQL configuration had been working and nothing had been altered there, I was deducing it was network related, not application related.

    When I installed Sugar, I had specified the server's name, not localhost or 127.0.0.1

    MySQL apprears to be configured only to respond to requests coming from apps through the loopback interface. A good security measure.

    At the time, the server's name must have been associated associated with the loopback interface in the /etc/hosts table.

    When Network Manager messed up, that association was eliminated. By manually inserting the servername (server) back against the loopback interface, Sugar came straight back up, without need to restart anything.

    /etc/hosts when broken:
    127.0.0.1 localhost localhost.localdomain
    192.168.1.101 server
    ...

    /etc/hosts when fixed
    127.0.0.1 server localhost localhost.localdomain
    192.168.1.101 server
    ...

    Thank you both for responding and pointing the way.

    Duncan

  5. #5
    reymondko is offline Junior Member
    Join Date
    May 2009
    Posts
    3

    Default Re: Can't connect to MySQL server on 'server' (111)

    i have the same problem but finally installed it on my CPANEL..

    Here is what I did:

    1. Create a database name , database username and password in the MYSQL Database wizard on your Cpanel.
    2. then go to the installation process. (If you have errors on the session part see below)
    3. so if you are on the Database part just input:
    HOST: localhost
    databasename: (the database name you created) siteexample_databasename
    Username: (the database username you created) siteexample_databaseusername
    Password: (ofcourse the password of the username you created)
    4. just click on okay to overwrite and continue...
    5. then just fill in what you need and click next untill installation is complete.


    FOr the session problem i found this in one of the forums here, and this is how they do it:
    Find this section in the file /install/installSystemCheck.php

    if(is_dir($session_save_path)){
    if(is_writable($session_save_path)){
    installLog("Session Save Path is ".$session_save_path);
    }else{
    $save_pathStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_WRITABLE']}</font></b>";
    installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_WRITABLE']}");
    $error_found = true;
    $error_txt .= '
    <tr>
    <td><strong>'.$mod_strings['LBL_CHECKSYS_SESSION_SAVE_PATH'].'</strong></td>
    <td class="error">'.$save_pathStatus.'</td>
    </tr>';
    }
    }
    else{
    $save_pathStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_SET']}</font></b>";
    installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_SET']}");
    $error_found = true;
    $error_txt .= '
    <tr>
    <td><strong>'.$mod_strings['LBL_CHECKSYS_SESSION_SAVE_PATH'].'</strong></td>
    <td class="error">'.$save_pathStatus.'</td>
    </tr>';
    }


    and then just comment everything on that part and it will turn out like this :


    /*if(is_dir($session_save_path)){
    if(is_writable($session_save_path)){
    installLog("Session Save Path is ".$session_save_path);
    }else{
    $save_pathStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_WRITABLE']}</font></b>";
    installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_WRITABLE']}");
    $error_found = true;
    $error_txt .= '
    <tr>
    <td><strong>'.$mod_strings['LBL_CHECKSYS_SESSION_SAVE_PATH'].'</strong></td>
    <td class="error">'.$save_pathStatus.'</td>
    </tr>';
    } */
    /*}
    else{
    $save_pathStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_SET']}</font></b>";
    installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_SET']}");
    $error_found = true;
    $error_txt .= '
    <tr>
    <td><strong>'.$mod_strings['LBL_CHECKSYS_SESSION_SAVE_PATH'].'</strong></td>
    <td class="error">'.$save_pathStatus.'</td>
    </tr>';
    }*/

  6. #6
    rosida88 is offline Junior Member
    Join Date
    Mar 2010
    Posts
    1

    Default Re: Can't connect to MySQL server on 'server' (111)

    Quote Originally Posted by reymondko View Post
    i have the same problem but finally installed it on my CPANEL..

    Here is what I did:

    1. Create a database name , database username and password in the MYSQL Database wizard on your Cpanel.
    2. then go to the installation process. (If you have errors on the session part see below)
    3. so if you are on the Database part just input:
    HOST: localhost
    databasename: (the database name you created) siteexample_databasename
    Username: (the database username you created) siteexample_databaseusername
    Password: (ofcourse the password of the username you created)
    4. just click on okay to overwrite and continue...
    5. then just fill in what you need and click next untill installation is complete.


    FOr the session problem i found this in one of the forums here, and this is how they do it:
    Find this section in the file /install/installSystemCheck.php

    if(is_dir($session_save_path)){
    if(is_writable($session_save_path)){
    installLog("Session Save Path is ".$session_save_path);
    }else{
    $save_pathStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_WRITABLE']}</font></b>";
    installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_WRITABLE']}");
    $error_found = true;
    $error_txt .= '
    <tr>
    <td><strong>'.$mod_strings['LBL_CHECKSYS_SESSION_SAVE_PATH'].'</strong></td>
    <td class="error">'.$save_pathStatus.'</td>
    </tr>';
    }
    }
    else{
    $save_pathStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_SET']}</font></b>";
    installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_SET']}");
    $error_found = true;
    $error_txt .= '
    <tr>
    <td><strong>'.$mod_strings['LBL_CHECKSYS_SESSION_SAVE_PATH'].'</strong></td>
    <td class="error">'.$save_pathStatus.'</td>
    </tr>';
    }


    and then just comment everything on that part and it will turn out like this :


    /*if(is_dir($session_save_path)){
    if(is_writable($session_save_path)){
    installLog("Session Save Path is ".$session_save_path);
    }else{
    $save_pathStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_WRITABLE']}</font></b>";
    installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_WRITABLE']}");
    $error_found = true;
    $error_txt .= '
    <tr>
    <td><strong>'.$mod_strings['LBL_CHECKSYS_SESSION_SAVE_PATH'].'</strong></td>
    <td class="error">'.$save_pathStatus.'</td>
    </tr>';
    } */
    /*}
    else{
    $save_pathStatus = "<b><span class='stop'>{$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_SET']}</font></b>";
    installLog("ERROR:: {$mod_strings['ERR_CHECKSYS_SESSION_SAVE_PATH_NOT_SET']}");
    $error_found = true;
    $error_txt .= '
    <tr>
    <td><strong>'.$mod_strings['LBL_CHECKSYS_SESSION_SAVE_PATH'].'</strong></td>
    <td class="error">'.$save_pathStatus.'</td>
    </tr>';
    }*/
    hai,reydmonko
    i have the same problem like you and i try your suggestion when installed it on CPANEL.
    i have the database problem. I already create database and database username and the password,but it didn't working.
    i dont know what's wrong or what's the problem.
    i also logout the CPANEL and login again,but it still didnt worked.
    maybe u can help me,thanks before

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Similar Threads

  1. Replies: 3
    Last Post: 2008-04-23, 12:38 PM
  2. Replies: 3
    Last Post: 2008-04-21, 11:09 PM
  3. Replies: 2
    Last Post: 2007-07-30, 02:58 AM
  4. Replies: 2
    Last Post: 2007-07-01, 09:55 PM
  5. Replies: 0
    Last Post: 2007-06-26, 11:38 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •