ติดตั้ง CentOS เลือก Minimal
BASE เลือก base
Server เลือก server และข้างใต้
copy my.cnf ตามขนาด RAM ของ server ไปใส่ /etc ไว้ก่อน
เช็ค default-character-set=tis620 ใน [mysqld] ให้เป็น character-set-server=tis620
ใช้ skip-external-locking
http://www.mediafire.com/download/y1xumxzpzahr9b6/my4g.cnf
https://www.mediafire.com/download/isq9ye9rnq6dhon/my2g.cnf
etc/sysconfig/iptables
# disabled - No SELinux policy is loaded.
SELINUX=disabled
ปิด Firewall พิมพ์ setup
/etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
/etc/security/limits.conf
root soft nofile 50000
root hard nofile 50000
mysql soft nofile 50000
mysql hard nofille 5000
/etc/rc.local
ulimit -n 3000
ลบ MySQL เดิม
rpm -qa|grep mysql
rpm -e --nodeps mysqlxxxxx
## Install MySQL MariaDB
cp my_MariaDB_xxx.cnf /etc/my.cnf
rpm -ivh MariaDB-5.5.32-centos6-x86_64-client.rpm --nodeps --force
rpm -ivh MariaDB-5.5.32-centos6-x86_64-shared.rpm --nodeps --force
rpm -ivh MariaDB-5.5.32-centos6-x86_64-server.rpm --nodeps --force
service mysql start
หาก pid error
rm -rf /var/lib/mysql/*
ls -al /var/lib/mysql/
chown -Rv mysql:mysql /var/lib/mysql/
sudo -u mysql mysql_install_db
service mysql start
/usr/bin/mysqladmin -u root password 'new-password'
สร้าง database
MariaDB [(none)]create database hosxp_pcu default character set tis620;
MariaDB [(none)]grant all privileges on *.* to 'pcu'@'%' identified by 'pcu' with grant option;
MariaDB [(none)]flush privileges;
ปรับปรุงและอ้างอิงจาก http://armdsdansai.blogspot.com/2013/08/mariadb-5532-for-centos6-64bit.html
http://dansai-com.blogspot.com/2013/04/server-hosxp.html