Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    58

    Unanswered: #2003 - Can't connect to MySQL server on 'localhost' (10061)

    Hello gys,

    I'm new in PHP, after installing Apache, PHP everything went good.
    But now I Have intalled the Mysql database and want use phpMyAdmin.
    When I try to connect to the Mysql server (http://localhost/PhpMyAdmin/index.php)I get the following error:

    #2003 - Can't connect to MySQL server on 'localhost' (10061)

    I installed the phpMyAdmin in the directory:
    C:\wwwphp\PhpMyAdmin

    in the config.inc.php I have the next:



    /**
    * Server(s) configuration
    */
    $i = 0;
    // The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
    // You can disable a server config entry by setting host to ''.
    $i++;
    $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
    $cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
    $cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
    $cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
    $cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
    // (requires PHP >= 4.3.0)
    $cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings
    // (this user must have read-only
    $cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
    // and "mysql/db" tables).
    // The controluser is also
    // used for all relational
    // features (pmadb)
    $cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
    $cfg['Servers'][$i]['user'] = ''; // MySQL user
    $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
    // with 'config' auth_type)
    $cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only
    // this db is displayed in left frame
    // It may also be an array of db-names, where sorting order is relevant.
    $cfg['Servers'][$i]['verbose'] = ''; // Verbose name for this host - leave blank to show the hostname

    $cfg['Servers'][$i]['pmadb'] = ''; // Database used for Relation, Bookmark and PDF Features
    // (see scripts/create_tables.sql)
    // - leave blank for no support
    // DEFAULT: 'phpmyadmin'
    $cfg['Servers'][$i]['bookmarktable'] = ''; // Bookmark table
    // - leave blank for no bookmark support
    // DEFAULT: 'pma_bookmark'
    $cfg['Servers'][$i]['relation'] = ''; // table to describe the relation between links (see doc)
    // - leave blank for no relation-links support
    // DEFAULT: 'pma_relation'
    $cfg['Servers'][$i]['table_info'] = ''; // table to describe the display fields
    // - leave blank for no display fields support
    // DEFAULT: 'pma_table_info'
    $cfg['Servers'][$i]['table_coords'] = ''; // table to describe the tables position for the PDF schema
    // - leave blank for no PDF schema support
    // DEFAULT: 'pma_table_coords'
    $cfg['Servers'][$i]['pdf_pages'] = ''; // table to describe pages of relationpdf
    // - leave blank if you don't want to use this
    // DEFAULT: 'pma_pdf_pages'
    $cfg['Servers'][$i]['column_info'] = ''; // table to store column information
    // - leave blank for no column comments/mime types
    // DEFAULT: 'pma_column_info'
    $cfg['Servers'][$i]['history'] = ''; // table to store SQL history
    // - leave blank for no SQL query history
    // DEFAULT: 'pma_history'
    $cfg['Servers'][$i]['verbose_check'] = TRUE; // set to FALSE if you know that your pma_* tables
    // are up to date. This prevents compatibility
    // checks and thereby increases performance.
    $cfg['Servers'][$i]['AllowDeny']['order'] // Host authentication order, leave blank to not use
    = '';
    $cfg['Servers'][$i]['AllowDeny']['rules'] // Host authentication rules, leave blank for defaults
    = array();
    $i++;
    $cfg['Servers'][$i]['host'] = '';
    $cfg['Servers'][$i]['port'] = '';
    .......
    etc....



    I have tried all I get from the internet but Dont come out.
    Any help wiil be appreciate
    Thank You in advance

  2. #2
    Join Date
    Jan 2004
    Location
    India
    Posts
    168
    Your config filse seems to be correct. The error indicats either you mysql is not running or your mysql is not installed properly. There would be a problem with you installation.
    to check whether mysql is working try these command
    ps -aux |grep mysqld
    or
    service mysqld status

    this will return the status of mysql.

    Regards
    Rajesh

  3. #3
    Join Date
    Mar 2004
    Posts
    58
    Thankt you Rajesh and all others

    I have looked to the services and mysql is wel running

    here is my config.inc.php onder c:/wwwphp/phpMyadmin
    but I get the following error
    #1045 - Access denied for user 'beginner'@'localhost' (using password: YES)

    config.inc.php
    <?php
    /* $Id: config.inc.php,v 2.5.2.1 2004/02/15 01:18:52 rabus Exp $ */
    // vim: expandtab sw=4 ts=4 sts=4:

    /**
    * phpMyAdmin Configuration File
    *
    * All directives are explained in Documentation.html
    */


    /**
    * Sets the php error reporting - Please do not change this line!
    */
    if (!isset($old_error_reporting)) {
    error_reporting(E_ALL);
    @ini_set('display_errors', '1');
    }


    /**
    * Your phpMyAdmin url
    *
    * Complete the variable below with the full url ie
    * http://www.your_web.net/path_to_your...min_directory/
    *
    * It must contain characters that are valid for a URL, and the path is
    * case sensitive on some Web servers, for example Unix-based servers.
    *
    * In most cases you can leave this variable empty, as the correct value
    * will be detected automatically. However, we recommend that you do
    * test to see that the auto-detection code works in your system. A good
    * test is to browse a table, then edit a row and save it. There will be
    * an error message if phpMyAdmin cannot auto-detect the correct value.
    *
    * If the auto-detection code does work properly, you can set to TRUE the
    * $cfg['PmaAbsoluteUri_DisableWarning'] variable below.
    */
    $cfg['PmaAbsoluteUri'] = '';


    /**
    * Disable the default warning about $cfg['PmaAbsoluteUri'] not being set
    * You should use this if and ONLY if the PmaAbsoluteUri auto-detection
    * works perfectly.
    */
    $cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;

    /**
    * Disable the default warning that is displayed on the DB Details Structure page if
    * any of the required Tables for the relationfeatures could not be found
    */
    $cfg['PmaNoRelation_DisableWarning'] = FALSE;

    /**
    * The 'cookie' auth_type uses blowfish algorithm to encrypt the password. If
    * at least one server configuration uses 'cookie' auth_type, enter here a
    * passphrase that will be used by blowfish.
    */
    $cfg['blowfish_secret'] = '';

    /**
    * Server(s) configuration
    */
    $i = 0;
    // The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
    // You can disable a server config entry by setting host to ''.
    $i++;
    $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
    $cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
    $cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
    $cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
    $cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
    // (requires PHP >= 4.3.0)
    $cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings
    // (this user must have read-only
    $cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
    // and "mysql/db" tables).
    // The controluser is also
    // used for all relational
    // features (pmadb)
    $cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
    $cfg['Servers'][$i]['user'] = 'beginner'; // MySQL user
    $cfg['Servers'][$i]['password'] = 'mytest'; // MySQL password (only needed
    // with 'config' auth_type)
    $cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only
    // this db is displayed in left frame
    // It may also be an array of db-names, where sorting order is relevant.
    $cfg['Servers'][$i]['verbose'] = ''; // Verbose name for this host - leave blank to show the hostname

    $cfg['Servers'][$i]['pmadb'] = ''; // Database used for Relation, Bookmark and PDF Features
    // (see scripts/create_tables.sql)
    // - leave blank for no support
    // DEFAULT: 'phpmyadmin'
    $cfg['Servers'][$i]['bookmarktable'] = ''; // Bookmark table
    // - leave blank for no bookmark support
    // DEFAULT: 'pma_bookmark'
    $cfg['Servers'][$i]['relation'] = ''; // table to describe the relation between links (see doc)
    // - leave blank for no relation-links support
    // DEFAULT: 'pma_relation'
    $cfg['Servers'][$i]['table_info'] = ''; // table to describe the display fields
    // - leave blank for no display fields support
    // DEFAULT: 'pma_table_info'
    $cfg['Servers'][$i]['table_coords'] = ''; // table to describe the tables position for the PDF schema
    // - leave blank for no PDF schema support
    // DEFAULT: 'pma_table_coords'
    $cfg['Servers'][$i]['pdf_pages'] = ''; // table to describe pages of relationpdf
    // - leave blank if you don't want to use this
    // DEFAULT: 'pma_pdf_pages'
    $cfg['Servers'][$i]['column_info'] = ''; // table to store column information
    // - leave blank for no column comments/mime types
    // DEFAULT: 'pma_column_info'
    $cfg['Servers'][$i]['history'] = ''; // table to store SQL history
    // - leave blank for no SQL query history
    // DEFAULT: 'pma_history'
    $cfg['Servers'][$i]['verbose_check'] = TRUE; // set to FALSE if you know that your pma_* tables
    // are up to date. This prevents compatibility
    // checks and thereby increases performance.
    $cfg['Servers'][$i]['AllowDeny']['order'] // Host authentication order, leave blank to not use
    = '';
    $cfg['Servers'][$i]['AllowDeny']['rules'] // Host authentication rules, leave blank for defaults
    = array();


    $i++;
    $cfg['Servers'][$i]['host'] = '';

    ......
    /?>
    </b>


    onder c:/windows I have the file

    my.ini

    # MySQL Configuration File
    [client]

    port=3306


    #
    # The MySQL server
    # This section is read by the MySQL Server
    #
    [mysqld]


    # The TCP/IP Port the MySQL Server will listen on
    port=3306

    #Path to installation directory. All paths are usually resolved relative to this.
    basedir=C:\mysql\

    #Path to the database root
    datadir=C:\mysql\Data\

    default-storage-engine=INNODB

    # The maximum amount of concurrent sessions the MySQL server will
    max_connections=100


    query_cache_size=0

    table_cache=256

    # Maximum size for internal (in-memory) temporary tables. If a table
    # grows larger than this value, it is automatically converted to disk
    # based table This limitation is for a single table. There can be many
    # of them.
    tmp_table_size=5M


    thread_cache=8

    #*** MyISAM Specific options
    myisam_max_sort_file_size=100G


    myisam_max_extra_sort_file_size=100G

    # If the temporary file used for fast index creation would be bigger
    # than using the key cache by the amount specified here, then prefer the
    # key cache method. This is mainly used to force long character keys in
    # large tables to use the slower key cache method to create the index.
    myisam_sort_buffer_size=8M

    # Size of the Key Buffer, used to cache index blocks for MyISAM tables.
    # Do not set it larger than 30% of your available memory, as some memory
    # is also required by the OS to cache rows. Even if you're not using
    # MyISAM tables, you should still set it to 8-64M as it will also be
    # used for internal temporary disk tables.
    key_buffer_size=4M

    # Size of the buffer used for doing full table scans of MyISAM tables.
    # Allocated per thread, if a full scan is needed.
    read_buffer_size=64K
    read_rnd_buffer_size=256K

    # This buffer is allocated when MySQL needs to rebuild the index in
    # REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE
    # into an empty table. It is allocated per thread so be careful with
    # large settings.
    sort_buffer_size=212K


    #*** INNODB Specific options ***



    innodb_additional_mem_pool_size=2M


    innodb_flush_log_at_trx_commit=1


    innodb_log_buffer_size=1M


    innodb_buffer_pool_size=5M


    innodb_log_file_size=10M


    innodb_thread_concurrency=8


    any body knows how I can solve this.
    I've tried all from the internet but I dont find a solution.
    Please any link or idea will be gratiful

    thanks in advance.

  4. #4
    Join Date
    Nov 2004
    Posts
    6
    look at the help pages on this

    $cfg['PmaAbsoluteUri'] = '';

    you need to add the directory address in here, cant remember what exactly but i know somethings gotta be in it, as i said the help pages will tell you

Posting Permissions

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