How config my.cnf ?

bendani

Verified User
Joined
Oct 16, 2005
Messages
32
how should i config my.cnf ?
mysql now is making a lot of load problems

i have P4 2.8 , 2 GB DDR
and 200 Sites on my server
but most of them are little...

28 Apache Requests for a sec so thats not biggy

what can i put in my.cnf that will be the best to my server ?
 
try this
Code:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
#skip-networking
safe-show-database
query_cache_limit=1M
query_cache_size=64M ## 32MB for every 1GB of RAM
query_cache_type=1
max_user_connections=200
max_connections=500
interactive_timeout=10
wait_timeout=20
connect_timeout=20
thread_cache_size=128
key_buffer=128M ## 64MB for every 1GB of RAM
join_buffer=1M
max_connect_errors=20
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M ## 1MB for every 1GB of RAM
read_buffer_size=2M ## 1MB for every 1GB of RAM
read_rnd_buffer_size=2M  ## 1MB for every 1GB of RAM
thread_concurrency=2 ## Number of CPUs x 2
myisam_sort_buffer_size=64M
server-id=1
log_slow_queries=/var/log/mysql-slow-queries.log
long_query_time=2
collation-server=latin1_general_ci
old-passwords

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

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

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

[mysqlhotcopy]
interactive-timeout


Wael
 
to load mysql with a config file, is a switch needed or will it look for the config automatically?

also, is there a way to tell mysql to write an output file to a dir other than /usr/mysql/data/db_name? i need to set up a config to allow a client to output to file in a dir that is accessible by apache for download, but i cannot see how to make it happen.

thanks

n/m on this, worked around this by using the /tmp and pulling from there.
 
Last edited:
MySQL should find /etc/my.cnf automatically if it exists.

You can change the database location in /etc/my.cnf (I don't know the details, but I think it has to be server-wide) but putting it where it can be downloaded by apache? Wouldn't you be better off letting apache follow a link?

Jeff
 
Back
Top