install / compile MYSQL 5 on RHEL / CentOS 4
There not much performance difference between MYSQL 4 and 5 as far as you're not using mysqli ext for your PHP scripts, but it nice to find rpms ready on Centos.org which makes the job much easier.
-
-
yum remove mysql mysql-devel mysql-server
-
mkdir mysql
-
cd mysql
-
wget http://mirror.centos.org/centos/4/centosplus/i386/RPMS/mysqlclient10-3.23.58-9.2.c4.i386.rpm
-
wget http://mirror.centos.org/centos/4/centosplus/i386/RPMS/mysqlclient10-devel-3.23.58-9.2.c4.i386.rpm
-
rpm -vih –nodeps mysqlclient*.rpm
-
wget http://mirror.centos.org/centos/4/centosplus/i386/RPMS/mysql-5.0.27-1.el4.centos.i386.rpm
-
wget http://mirror.centos.org/centos/4/centosplus/i386/RPMS/mysql-devel-5.0.27-1.el4.centos.i386.rpm
-
wget http://mirror.centos.org/centos/4/centosplus/i386/RPMS/mysql-server-5.0.27-1.el4.centos.i386.rpm
-
rpm -vih –nodeps mysql-*.rpm
-
chkconfig –levels 235 mysqld on
-
service mysqld start
-
mysql_install_db –user=mysql
-
#make sure it’s running
-
netstat -tap
-
#if upgrading DB
-
mysql_fix_privilege_tables -p
-
#if no privileges set yet
-
mysqladmin -u root password newpassword
-
-
unless you have really heavy loaded server, this configuration might not make sense or maybe waste your recourses
-
-
mv /etc/my.cnf /etc/my.cnf.old
-
vi /etc/mycnf
-
[mysqld]
-
#datadir=/var/lib/mysql
-
#socket=/var/lib/mysql/mysql.sock
-
skip-locking
-
skip-innodb
-
query_cache_limit=1M
-
query_cache_size=200M
-
query_cache_type=1
-
max_connections=2000
-
interactive_timeout=20
-
wait_timeout=15
-
connect_timeout=5
-
thread_cache_size=500
-
key_buffer=16M
-
join_buffer=1M
-
max_allowed_packet=16M
-
table_cache=1024
-
record_buffer=1M
-
sort_buffer_size=2M
-
read_buffer_size=2M
-
max_connect_errors=5
-
# Try number of CPU’s*2 for thread_concurrency
-
thread_concurrency=4
-
myisam_sort_buffer_size=200M
-
log-bin
-
server-id=1
-
[mysql.server]
-
user=mysql
-
basedir=/var/lib
-
[safe_mysqld]
-
#pid-file=/var/lib/mysql/mysql.pid
-
open_files_limit=30000
-
## logs are good
-
log-slow-queries
-
long-query-time=2
-
log-queries-not-using-indexes
-
#err-log=/myserver/logs/mysql.error.log
-
[mysqldump]
-
quick
-
max_allowed_packet=16M
-
[mysql]
-
no-auto-rehash
-
#safe-updates
-
[isamchk]
-
key_buffer=64M
-
sort_buffer=64M
-
read_buffer=16M
-
write_buffer=16M
-
[myisamchk]
-
key_buffer=64M
-
sort_buffer=64M
-
read_buffer=16M
-
write_buffer=16M
-
[mysqlhotcopy]
-
interactive-timeout
-
you might need to recompile PHP if your using fcgi

