이유를하다 내가 실행할 때는 ERROR 1040 제공 - 너무 많은 연결을
ANALYZE TABLE table_name_here
MySQL 서버가이 오류 밖으로주고 시작합니다
1040 - 너무 많은 연결
나는 이것을 PHPMyAdmin btw를 통해 실행했습니다.
그리고이 테이블에는 1,500 만 개가 넘는 데이터 행이 있습니다. 이 문제를 해결할 수있는 방법이 있습니까?
MySQLTuner 결과 :
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.91-rs-log
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB +Federated -InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 10G (Tables: 192)
[!!] Total fragmented tables: 14
-------- Security Recommendations -------------------------------------------
ERROR 1142 (42000) at line 1: SELECT command denied
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 21m 37s (134K q [103.756 qps], 982 conn, TX: 267M, RX: 20M)
[--] Reads/Writes: 88%/12%
[--] Total buffers: 1.2G global + 22.2M per thread (120 max threads)
[!!] Maximum possible memory usage: 3.8G (99% of installed RAM)
[OK] Slow queries: 0% (4/134K)
[OK] Highest usage of available connections: 14% (17/120)
[OK] Key buffer size/total MyISAM indexes: 1.0G/2.9G
[OK] Key buffer hit rate: 97.7% (1M cached/25K reads)
[OK] Query cache efficiency: 72.7% (92K cached/127K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts/6K sorts)
[!!] Joins performed without indexes: 492
[!!] Temporary tables created on disk: 44% (490 on disk/1K total)
[OK] Thread cache hit rate: 98% (17 created/982 connections)
[OK] Table cache hit rate: 97% (262 open/268 opened)
[OK] Open file limit used: 0% (463/65K)
[OK] Table locks acquired immediately: 99% (78K immediate/78K locks)
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Reduce your overall MySQL memory footprint for system stability
Adjust your join queries to always utilize indexes
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
join_buffer_size (> 10.0M, or always use indexes with joins)
tmp_table_size (> 192M)
max_heap_table_size (> 192M)
원래 내 키 버퍼 크기 만 64메가바이트로 설정했다. 키 버퍼 크기를 1GB로 설정하면 최대 접속 사용자 수는 해당 명령을 실행하는 동안 17시에 최고점에 도달했습니다. 그리고 64MB로만 설정되었을 때 항상 허용 된 최대 연결 사용자 수에 도달했습니다. 내 서버가 4GB RAM에만 국한되므로이 설정을 더 높게 설정할 수는 없습니다.
http://rackerhacker.com/2008/06/24/mysql-error-1040-too-many-connections/ - 분석 테이블과 관련이없는 구성 문제입니다. Analysis를 실행하면 연결이 잠기고 구성된 한계 근처에서 실행하면이 문제가 표시됩니다. –
MySQLTuner 결과를 추가했는데 몇 가지 사항을 변경했으며 그 명령을 실행할 때 "연결이 너무 많습니다"라는 오류가 표시되지 않지만 MySQL 최대 메모리 사용량이 너무 높습니다. 나는 이것이 너무 큰 색인을 가진 테이블과 관련이 있다고 생각한다. 어쨌든이 문제를 해결하려면? – officeboi101