MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 7073|回复: 4
打印 上一主题 下一主题

mysql数据库停留在opening table是生么原因造成的?

[复制链接]
跳转到指定楼层
1#
发表于 2011-11-2 18:21:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
請指點
CUP P4 3.0 超線程雙核,內存4G 裝有3個mysql數據庫服務,其中一個數據庫配置如下:
[mysqld]
basedir=D:/MySQL
#bind-address=172.16.5.44
datadir=D:/MySQL/data
#language=D:/MySQL/share/your language directory
default-character-set=latin1
default-storage-engine=INNODB
#slow query log
#tmpdir
#port=3306

#log-bin=mysql-bin
# lsc 10-30
#log_slow_queries=5
#log_slow=log=D:\Log\Slow.log

skip-locking
skip-name-resolve

back_log=50
#(Unknown optionconnect_timeout=10
key_buffer_size=128M
thread_stack = 256K
thread_cache_size=48
thread_cache=48

join_buffer_size=8M
sort_buffer_size=2M
max_connections=100
wait_timeout=120
interactive_timeout=120
#max_connect_errors=1000
long_query_time=1
max_heap_table_size=98M
tmp_table_size=256M

max_allowed_packet=1M
net_buffer_length=16K
thread_concurrency=4


#*** MyISAM Specific options
myisam_max_sort_file_size=100M
myisam_max_extra_sort_file_size=100M
myisam_sort_buffer_size=64M
myisam_repair_threads = 1
read_buffer_size = 256K
read_rnd_buffer_size=2M
sort_buffer_size=2M


open_files_limit=512

bulk_insert_buffer_size = 138M

query_cache_type=2
query_cache_size=16M
query_cache_limit=128k

table_cache=256



#*** INNODB Specific options ***
innodb_additional_mem_pool_size=6M
innodb_buffer_pool_size=512M
innodb_flush_log_at_trx_commit=2
innodb_log_buffer_size=3M
innodb_log_file_size=100M
innodb_thread_concurrency=8
innodb_lock_wait_timeout = 120
innodb_file_io_threads=10
innodb_open_files=800

innodb_max_dirty_pages_pct = 90


innodb_file_io_threads=10


server-id=3
master-host=172.16.250.250
master-user=backup
master-password=1234


#Flush tables to disk between SQL commands.
flush
#INSERT/DELETE/UPDATE has lower priority than selects.
low-priority-updates
#Lock mysqld in memory.(=Don't swap.)
memlock

[WinMySQLadmin]
Server=D:/MySQL/bin/mysqld-nt.exe
user=ellbl
password=szsunlbl

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=126M
sort_buffer=126M
read_buffer=16M
write_buffer=16M

[mysqldump]
quick
set-variable = max_allowed_packet=16M
SQL_QUOTE_SHOW_CREATE=0


[mysql]
#no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[mysqlhotcopy]
interactive-timeout

[mysqld_safe]
open-files-limit = 8192
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享淘帖 顶 踩
2#
发表于 2011-11-3 09:57:48 | 只看该作者
什么情况下停留?
3#
发表于 2011-11-3 18:48:11 | 只看该作者
同问。我也遇到同样问题
4#
 楼主| 发表于 2011-11-4 18:25:31 | 只看该作者
大约1小时左右有一两个或多个WEB(apache+php+mysql)用户使用时,用户使用show指令就会卡,不一会儿就停留在opening tables状态,用户无法连接数据库,线程很快就被站满。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-4-23 15:20 , Processed in 0.101097 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表