路过的兄弟帮看看my.ini 配置是哪里有问题,经常出现Cann't connect to DB服务器配置:
Windows Server 2003 Enterprise Edition Service Pack 2
CPU 四核酷睿2.5G  内存4G DDRII
phpMyAdmin 出错警告(红字)
此 MySQL 服务器已经运行了 1 天 1 小时,8 分 8 秒,启动时间为 2012 年 07 月 02 日 11:01。
最大并发连接数 74
已失败 38
已取消 73
查询统计:自启动后,服务器共收到了 3,131,088 次查询。
Slow_queries 745
Handler_read_rnd 2,001 k
Handler_read_rnd_next 4,268.62 M
Qcache_lowmem_prunes 164 k
Slow_launch_threads 1
Created_tmp_disk_tables 4
Key_reads 343 k        
Key_writes 272 k
Opened_tables 4,213
Table_locks_waited 2,929My.ini 配置
port=3306
basedir="D:/MySQL/MySQL Server 5.1/"
datadir="C:/MySQL/MySQL Server 5.1/Data/"
default-character-set=gbk
default-storage-engine=MYISAM
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=100
max_connect_errors=500
log_slow_queries
long_query_time=5
log_long_format
back_log=50
binlog_cache_size=1M
transaction_isolation=REPEATABLE-READ
log-bin=mysql-bin
query_cache_size=64M
query_cache_limit=2M
table_cache=2048
open_files_limit=8192
max_allowed_packet=16M
thread_stack=192K
tmp_table_size=64M
max_heap_table_size=64M
thread_cache_size=8myisam_max_sort_file_size=10G
myisam_max_extra_sort_file_size=10G
myisam_repair_threads=1
myisam_recover
concurrent_insert=2
myisam_sort_buffer_size=128M
key_buffer_size=1024M
read_buffer_size=2M
read_rnd_buffer_size=16M
join_buffer_size=8M
bulk_insert_buffer_size=64M
sort_buffer_size=6Minnodb_data_home_dir="D:/MySQL/MySQL Server 5.1/Docs/"
skip-innodb
innodb_file_io_threads=4
innodb_data_file_path=ibdata1:10M:autoextend
innodb_additional_mem_pool_size=16M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=8M
innodb_buffer_pool_size=2G
innodb_log_file_size=256M
innodb_lock_wait_timeout=120
innodb_max_dirty_pages_pct=90
innodb_log_files_in_group=3
innodb_thread_concurrency=8

解决方案 »

  1.   

    default-storage-engine=innodbinnodb_flush_log_at_trx_commit=0
      

  2.   

    如果Opened_tables太大,那么你的table_cache变量可能太小。 
    如果key_reads太大,那么你的key_cache可能太小。缓存命中率可以用key_reads/key_read_requests计算。 
    如果Handler_read_rnd太大,那么你很可能有大量的查询需要MySQL扫描整个表或你有没正确使用键值的联结(join)。 具体怎么调整?
      

  3.   

    max_used_connections / max_connections * 100% (理想值 ≈ 85%)我的max_used_connections 74