MySQL error “Row XXX was cut by GROUP_CONCAT()”


使用 MySQL GROUP_CONCAT時, 會出現錯誤訊息如標題.

這時就要設定MySQL的

SET group_concat_max_len=15000;

15000隨個人需求設定.

參考
http://stackoverflow.com/questions/7208773/mysql-row-30153-was-cut-by-group-concat-error

FreeBSD SFTP 設定

參考這篇

http://bin63.com/how-to-set-up-an-sftp-user-on-freebsd

phpMyAdmin 隱藏資料庫 information_schema


單一隱藏
$cfg['Servers'][$i]['hide_db'] = 'information_schema';

多個隱藏則使用正規表達式
$cfg['Servers'][$i]['hide_db'] = '(information_schema|phpmyadmin|mysql)';


參考這篇
http://wiki.phpmyadmin.net/pma/Talk:Config


Apache & MySQL Connection Setting


Apache
  1. 檢查Apache 版本及運行腳本
    httpd -v, httpd -l
  2. 設定Apache22/extra/httpd-mpm.conf
  3. 找到腳本設定
    
        StartServers          5
        MinSpareServers       5
        MaxSpareServers       10
        MaxClients            1000 (150改1000)
        MaxRequestsPerChild   2000 (0改2000)
  4. 重啟Apache
    

MySQL
  1. 找到my.cnf
  2. 在[mysqld]下加入 max_connections = 1000
  3. 重啟MySQL

參考
合理設置apache-httpd的最大連接數






PHP cURL POST IIS


使用PHP curl POST 給IIS時要把字陣列改成字串


原本
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array('foo' => 'bar'));

改成
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, 'foo=bar');

MySQL CAST String to Integer



SELECT * FROM table ORDER BY CAST(column, SIGNED) DESC;