Install Mysql di Freebsd
Catatan kecil cara install mysql agar saya tidak lupa. Disini yang akan saya install adalah mysql versi 5.5 di box Freebsd 10 melalui port.
Update port terlebih dahulu
# portsnap fetch update Looking up portsnap.FreeBSD.org mirrors... 7 mirrors found. Fetching snapshot tag from ec2-ap-southeast-2.portsnap.freebsd.org... done. Fetching snapshot metadata... done. Updating from Wed Sep 3 15:20:23 WIB 2014 to Thu Sep 4 12:15:58 WIB 2014. Fetching 4 metadata patches... done. Applying metadata patches...
masuk direktori port mysql55-server
# cd /usr/ports/databases/mysql55-server/ # make install clean
Langkah di atas otomatis juga menginstall package2 yang diperlukan salah satunya mysql55-client. Setelah proses selesai instalasinya, kemudian edit file /usr/local/etc/my.cnf . Seandainya file tersebut tidak ada bisa langsung di create saja dengan perintah:
# ee /usr/local/etc/my.cnf
masukkan konfigurasi file my.cnf seperti contoh berikut:
[client] #password = [your_password] port = 3306 socket = /tmp/mysql.sock [mysqld] port = 3306 socket = /tmp/mysql.sock back_log = 50 #skip-networking max_connections = 200020 max_user_connections = 200000 max_connect_errors = 99999999999 log-error=mysql.err max_allowed_packet = 64M binlog_cache_size = 1M max_heap_table_size = 64M thread_cache_size = 256 #8 thread_concurrency = 8 log-bin=mysql-bin binlog_format=mixed #skip-innodb innodb_additional_mem_pool_size = 16M innodb_buffer_pool_size = 3G innodb_data_file_path = ibdata1:10M:autoextend innodb_flush_log_at_trx_commit = 0 #1 innodb_log_buffer_size = 8M innodb_log_file_size = 64M #256M innodb_log_files_in_group = 2 #3 innodb_max_purge_lag=0 innodb_flush_method=O_DIRECT #O_DSYNC sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash [myisamchk] key_buffer_size = 512M sort_buffer_size = 512M read_buffer = 8M write_buffer = 8M [mysqlhotcopy] interactive-timeout [mysqld_safe] open-files-limit = 8192
Konfigurasi file my.cnf di atas hanyalah sample yang saya terapkan di box freebsd dengan spesifikas 8 Core CPU ram 8Gb berjalan di atas virtualisasi VMware Vcenter.
Masukkan setting di /etc/rc.conf baris berikut agar service mysql bisa autostart
mysql_enable="YES"
Kemudian start service mysqld
# /usr/local/etc/rc.d/mysql-server start
Jika terjadi error ataupun service mysql tidak dapat running ,bisa dibuka di direktori mysql nya file mysql.err