gentoo-runs-mysql5-and-4
download source of mysql4 server
wget http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-4.1.22.tar.gz/from/http://mysql.he.net/ tar -zxvf mysql-4.1.22.tar.gz cd mysql-4.1.22
compile mysql
./configure --prefix=/var/lib/mysql4 \ --with-unix-socket-path=/var/lib/mysql4/mysql4.sock \ --with-tcp-port=3307 make make install
edit/create mc4.cnf [vi /etc/my4.cnf]
# Example MySQL config file for large systems. ## This is for a large system with memory = 512M where the system runs mainly MySQL. ## You can copy this file to # /etc/my.cnf to set global options, # mysql-data-dir/my.cnf to set server-specific options (in this # installation this directory is /var/lib/mysql4/var) or # ~/.my.cnf to set user-specific options. ## In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program # with the "--help" option. # The following options will be passed to all MySQL clients #[client] #password = your_password #port = 3307 #socket = /var/lib/mysql4/mysql4.sock # Here follows entries for some specific programs # The MySQL server [mysqld] port = 3307 socket = /var/lib/mysql4/mysql4.sock old_passwords=1 skip-locking key_buffer = 128M max_allowed_packet = 1M table_cache = 256 sort_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 4M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size= 16M [mysql.server] user=mysql [mysql] default-character-set=latin1 [mysqld_safe] err-log=/var/log/mysqld_4.log pid-file=/var/lib/mysql4/mysqld4.pid
create directions and set mysql permissions
mkdir /var/lib/mysql4/var chown mysql:mysql /var/lib/mysql4
finilizing
./scripts/mysql_install_db --defaults-file=/etc/my4.cnf --user=mysql /var/lib/mysql4/bin/mysqld_safe --defaults-file=/etc/my4.cnf --user=mysql & /var/lib/mysql4/bin/mysqladmin -u root password 'new-password' /var/lib/mysql4/bin/mysql -u root -p
