LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1009|回复: 5

MySQL的配置问题

[复制链接]
发表于 2004-8-15 23:14:18 | 显示全部楼层 |阅读模式
我的服务器的配置是:
双至强2.4G
内存:2G
我的系统是FreeBSD5.2.1(R)
Apache/2.0.48 (Unix) PHP/4.3.4 MySQL-4.0.20
编译后能正常启动
我想修改一下MySQL配置文件
增加最大连接数,但我重启MySQL服务器时出现了一下错误
我在.err文件的提示如下:

040815 01:53:36  mysqld started
Warning: Ignoring user change to 'root' because the user was set to 'mysql' earlier on the command line
mysqld in malloc(): error: allocation failed
mysqld got signal 6;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=536870912
read_buffer_size=33550336
max_used_connections=0
max_connections=512
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 522236 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

mysqld in free(): error: recursive call
Fatal signal 6 while backtracing
040815 01:53:36  mysqld ended


key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 522236 K 这一句好像在说可能用掉500多M内存
但我有2G内存,应该够了吧
但总是启动不了
这是什麽原因啊?
 楼主| 发表于 2004-8-15 23:17:18 | 显示全部楼层
附上我的my.cnf文件如下:
麻烦大家帮忙分析一下:
[client]
#password        = your_password
port                = 3306
socket                = /home/mysql/var/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port                = 3306
socket                = /home/mysql/var/mysql.sock
skip-locking
key_buffer = 512M
max_allowed_packet = 4M
table_cache = 1024
sort_buffer_size = 512K
net_buffer_length = 8K
myisam_sort_buffer_size = 128M
long_query_time=1
join_buffer_size=32M
connect_timeout=20
max_connect_errors=30000
max_connections=512
sort_buffer=32M
record_buffer=32M
thread_cache=64
skip-bdb
skip-innodb
wait_timeout=120
interactive_timeout=120
max_heap_table_size=256M
tmp_table_size=128M
thread_concurrency=8
[mysqldump]
quick
max_allowed_packet = 4M

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

[isamchk]
key_buffer = 128M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M


[mysqlhotcopy]
interactive-timeout
 楼主| 发表于 2004-8-16 09:42:02 | 显示全部楼层
这个我又将key_buffer 改为256
max_connections改为800
结果就能启动MySQL了
 楼主| 发表于 2004-8-16 15:09:56 | 显示全部楼层
又出问题了
我修改了配置文件,正常启动MySQL以后
过一段时间服务器就说不能通过mysql.sock连接数据库了

我分析了一下是:
系统不能杀死mysql僵死的进程
我用mysql用户编译的MySQL啊,进程也显示是mysql的
请问怎麽办啊?


附上我的配置文件:(my.cnf)
[client]
#password = your_password
port = 3306
socket = /home/mysql/var/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /home/mysql/var/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 4M
table_cache = 1024
sort_buffer_size = 512K
net_buffer_length = 8K
myisam_sort_buffer_size = 128M
long_query_time=1
join_buffer_size=32M
connect_timeout=20
max_connect_errors=30000
max_connections=800
sort_buffer=32M
record_buffer=32M
thread_cache=64
skip-bdb
skip-innodb
wait_timeout=120
interactive_timeout=120
max_heap_table_size=256M
tmp_table_size=128M
thread_concurrency=8
[mysqldump]
quick
max_allowed_packet = 4M

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

[isamchk]
key_buffer = 128M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M


[mysqlhotcopy]
interactive-timeout
 楼主| 发表于 2004-8-16 21:35:31 | 显示全部楼层
有没有人邦兄弟一把
现在又坏了
网站速度剧慢
 楼主| 发表于 2004-8-17 08:09:24 | 显示全部楼层
好像是其中有个表经常被锁住
can‘t connect through MySQL socket
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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