วันจันทร์ที่ 21 พฤษภาคม พ.ศ. 2561

วันอาทิตย์ที่ 20 พฤษภาคม พ.ศ. 2561

Install Mysql MariaDB 5.5.32


Install Mysql MariaDB 5.5.32

[root@hosxp ~]#vi /etc/selinux/config
#     disabled - No SELinux policy is loaded.
SELINUX=disabled

[root@hosxp ~]#vi /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

[root@hosxp ~]#vi /etc/security/limits.conf
# เพิ่มข้อมูลนี้เข้าไป
root     soft     nofile     50000
root     hard     nofile     50000
mysql     soft     nofile     50000
mysql     hard     nofile     50000


## ลบ MySQL ในเครื่องออก
[root@hosxp ~]#rpm -qa|grep mysql
[root@hosxp ~]#rpm -e --nodeps mysqlxxxxx
[root@hosxp ~]cp my_MariaDB_xxx.cnf /etc/my.cnf

## Install MySQL MariaDB
[root@hosxp ~]#rpm -ivh MariaDB-5.5.32-centos6-x86_64-client.rpm --nodeps --force
[root@hosxp ~]#rpm -ivh MariaDB-5.5.32-centos6-x86_64-shared.rpm --nodeps --force
[root@hosxp ~]#rpm -ivh MariaDB-5.5.32-centos6-x86_64-server.rpm --nodeps --force

[root@hosxp ~] service mysql start

** หาก Start MySQL ไม่ได้ บอก pid error ให้ทำตามนี้
[root@hosxp ~]rm -rf /var/lib/mysql/*
[root@hosxp ~]ls -al /var/lib/mysql/
[root@hosxp ~]chown -Rv mysql:mysql /var/lib/mysql/*
[root@hosxp ~]sudo -u mysql mysql_install_db
[root@hosxp ~]service mysql start

[root@hosxp ~]/usr/bin/mysqladmin -u root password 'new-password'

##MySQL Create database
[root@hosxp ~]mysql -u root -p  << Enter

MariaDB [(none)]>create database pcu_nonghin default character set tis620;
MariaDB [(none)]>grant all on *.* to sa@'%' identified by 'sa' with grant option;
MariaDB [(none)]>flush privileges;
MariaDB [(none)]>Ctrl-C -- exit!
Aborted
[root@hosxp ~]

log-bin=mysql-bin
server-id=1

 mysql-bin.000001 |   211941

 CHANGE MASTER TO MASTER_HOST='192.168.5.6',
                        MASTER_USER='repl',
                        MASTER_PASSWORD='repl10705',
                        MASTER_LOG_FILE='mysql-bin.000001',
                        MASTER_LOG_POS=211941;

## TIPS ##

cat /etc/redhat-release
rpm -q centos-release
mysql -V

SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'dbName';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.5.8' IDENTIFIED BY 'rep10705';

วันพฤหัสบดีที่ 21 เมษายน พ.ศ. 2559

วันจันทร์ที่ 1 กุมภาพันธ์ พ.ศ. 2559

เพิ่มให้ Server สามารถอ่านภาษาไทยได้


เพิ่มให้ Server สามารถอ่านภาษาไทยได้

อันดับแรกตรวจสอบดูว่า MariaDB เซ็ตภาษาไว้ไหม คำสั่ง show variables like'%char%'



วันอาทิตย์ที่ 31 มกราคม พ.ศ. 2559

วิธีฝัง Embed ใน Yii2


วิธีฝัง Embed ใน Yii2


<div class="embed-responsive embed-responsive-16by9">
        <iframe class="embed-responsive-item"
                         src="//www.youtube.com/embed/8RqcjnPle_Q"></iframe>
</div>

วันเสาร์ที่ 30 มกราคม พ.ศ. 2559

TeamView 11 Premium



เข้า C;// ค้นหาคำว่า temview แล้วลบออกให้หมอ
ไฟล์   =  team viewer 11+crack.rar

วันพุธที่ 27 มกราคม พ.ศ. 2559

Maximum upload size แก้ไขค่าที่ต้องการ upload ไฟล์ขนาดใหญ่


Maximum upload size แก้ไขค่าที่ต้องการ upload ไฟล์ขนาดใหญ่

upload_max_filesize หรือ post_max_filesize
ปกติระบบจะรับข้อมูลฟอร์มเป็นแบบ POST ซึ่งข้อมูลอาจจะการ UPLOAD ไฟล์มาด้วย ดังนั้น post_max_filesize จึงควรมีขนาดมากกว่า upload_max_filesize
memory_limit
เมื่อข้อมูลส่งเข้ามาแบบ POST ระบบจะเก็บข้อมูลบางส่วนไว้ในหน่วยความจำ การตั้งค่าสูงเกินไปอาจทำให้บางโปรแกรมที่มี bug ถือโอกาสนี้กินหน่วยความจำมากเกินไปจนส่งผลกระทบกับระบบทั้งหมด
max_execute_time หรือ max_input_time
หากข้อมูลมีปริมาณเยอะมาก ก็จะต้องใช้เวลาในการ upload นาน เช่น ไฟล์ขนาด 1 MB ใช้ upload 32 kbps จะใช้เวลา 256 วินาที (4 นาที 16 วินาที) ซึ่งก็ต้องเผื่อเวลาให้ PHP จัดการกับไฟล์ขนาดใหญ่ด้วย