mysql 查詢小記 - 筆記搬遷1

筆記搬遷

1、MYSQL對INT和VACHAR很敏感,尤其是MYSQL5.7。比如:between '1' and '5',我查出來的是空,可 between 1 and 5,數據纔出來

2、int 與 vachar (mysql類型轉換後無法使用索引)

日期存儲 `report_date` char (如 20170325)
where `report_date` = 20170325 (索引用不到)
where `report_date` = '20170325' (索引可用到【必須是字符串類型】)

3、複製粘貼專用(自用)

mysql
grant all privileges on *.* to stone@"%" identified by "lover";

firewall
firewall-cmd --permanent --add-port=9501/tcp

內存/CPU 佔用 top 10
ps aux|head -1; ps aux | sort -k4nr | head -10
ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head

nginx設置密碼
    htpasswd -c -d /usr/local/nginx/conf/vhost/static_pass  username
    location ~ /admin {
            auth_basic "Restricted";
            auth_basic_user_file /usr/local/nginx/conf/vhost/static_pass;//請使用絕對路徑
            root   /home/www/admin; //host 地址,不然認證通過之後,找不到對應的文件
    }  
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章