Results 1 to 4 of 4

Thread: MSQL 5.1 Error establishing a database connection

  1. #1
    Member saamxvr's Avatar
    Join Date
    Oct 2010
    Posts
    71

    Default MSQL 5.1 Error establishing a database connection

    Hello i have Intel(R) Xeon(TM) CPU 2.40GHz x4 , 2GB ram Dedicate server , im run 3 Wordpress site on it , my Server Load Averages is: 0.62 0.57 0.46

    Mostly i getting this error (Error establishing a database connection )
    I'm using MYSQL 5.1

    this is before optimized my.cnf

    [mysqld]
    set-variable = max_connections=500
    log-slow-queries
    safe-show-database
    this is after optimized my.cnf

    [mysqld]
    set-variable = max_connections=500
    log-slow-queries
    safe-show-database
    query_cache_type=1
    query_cache_size=128M
    query_cache_limit=5M
    sort_buffer_size=4M
    read_rnd_buffer_size=512K
    tmp_table_size=256M
    max_heap_table_size=384M
    thread_cache_size=32
    key_buffer_size=128M
    table_cache=1184
    This is Tuner Result

    root@server [~]# ./mysqltuner.pl

    >> MySQLTuner 1.0.1 - Major Hayden <major@mhtx.net>
    >> Bug reports, feature requests, and downloads at MySQLTuner
    >> Run with '--help' for additional options and output filtering

    -------- General Statistics --------------------------------------------------
    [--] Skipped version check for MySQLTuner script
    [OK] Currently running supported MySQL version 5.1.51-log
    [OK] Operating on 32-bit architecture with less than 2GB RAM

    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
    [--] Data in MyISAM tables: 747M (Tables: 1133)
    [--] Data in InnoDB tables: 240K (Tables: 15)
    [--] Data in MEMORY tables: 0B (Tables: 6)
    [!!] Total fragmented tables: 22

    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 3s (30 q [10.000 qps], 6 conn, TX: 132K, RX: 3K)
    [--] Reads / Writes: 80% / 20%
    [--] Total buffers: 522.0M global + 4.9M per thread (500 max threads)
    [!!] Allocating > 2GB RAM on 32-bit systems can cause system instability
    [!!] Maximum possible memory usage: 2.9G (147% of installed RAM)
    [OK] Slow queries: 0% (0/30)
    [OK] Highest usage of available connections: 0% (1/500)
    [OK] Key buffer size / total MyISAM indexes: 128.0M/126.0M
    [!!] Key buffer hit rate: 57.1% (49 cached / 21 reads)
    [!!] Query cache efficiency: 0.0% (0 cached / 17 selects)
    [OK] Query cache prunes per day: 0
    [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 1 sorts)
    [OK] Temporary tables created on disk: 0% (0 on disk / 2 total)
    [OK] Thread cache hit rate: 83% (1 created / 6 connections)
    [OK] Table cache hit rate: 68% (11 open / 16 opened)
    [OK] Open file limit used: 0% (23/2K)
    [OK] Table locks acquired immediately: 100% (25 immediate / 25 locks)
    [OK] InnoDB data size / buffer pool: 240.0K/8.0M

    -------- Recommendations -----------------------------------------------------
    General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Variables to adjust:
    *** MySQL's maximum memory usage is dangerously high ***
    *** Add RAM before increasing MySQL buffer variables ***
    query_cache_limit (> 5M, or use smaller result sets)

  2. #2
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,463
    cPanel/WHM Access Level

    Root Administrator

    Default Friendly moderator note

    I moved this thread to our Database Discussions section.
    For hands-on assistance, please reference our new support information page: Where should I go for support?
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation - Find cPanel hosting


    -- Jared Ryan, Technical Analyst, cPanel Technical Support

  3. #3
    Member
    Join Date
    May 2010
    Posts
    321

    Default Re: MSQL 5.1 Error establishing a database connection

    Variables to adjust:
    *** MySQL's maximum memory usage is dangerously high ***
    *** Add RAM before increasing MySQL buffer variables ***
    query_cache_limit (> 5M, or use smaller result sets)
    *** MySQL's maximum memory usage is dangerously high ***
    *** Add RAM before increasing MySQL buffer variables ***


    max_connections=500

    Put this to max_connections=100 - why do you need 500 ? Your not running ebay are you ?

    query_cache_limit=5M
    This means make it higher.

    so now your my.cnf should look like:

    [mysqld]
    max_connections=100
    log-slow-queries
    safe-show-database
    query_cache_type=1
    query_cache_size=128M
    query_cache_limit=6M
    sort_buffer_size=4M
    read_rnd_buffer_size=512K
    tmp_table_size=256M
    max_heap_table_size=384M
    thread_cache_size=32
    key_buffer_size=128M
    table_cache=1184

  4. #4
    Member saamxvr's Avatar
    Join Date
    Oct 2010
    Posts
    71

    Default Re: MSQL 5.1 Error establishing a database connection

    Yes i will add this Thanks lot .!!!

    one more question why MSQL server restarting auto ? i was use 5.0 , now im use 5.1 , i never face this problem on 5.0 , plz can you give some more info about that ? my server load just fine , only thing DB error .

Similar Threads

  1. MSQL 5.1 Error establishing a database connection
    By saamxvr in forum New User Questions
    Replies: 0
    Last Post: 12-22-2010, 11:32 PM
  2. Please Help! Error establishing a database connection
    By IMM in forum New User Questions
    Replies: 2
    Last Post: 02-27-2010, 11:01 PM
  3. Database Error: Connection Failed!
    By bashcpanel in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 06-27-2008, 04:38 PM
  4. MSQL database mirror
    By nerdzoll in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 08-17-2005, 06:28 PM
  5. Database connection error
    By shady in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 09-12-2003, 01:16 PM