笔记搬迁
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 [email protected]"%" identified by "lover";
firewall
firewall-cmd --permanent --add-port=/tcp
内存/CPU 占用 top
ps aux|head -; ps aux | sort -k4nr | head -
ps aux|head -;ps aux|grep -v PID|sort -rn -k +|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 地址,不然认证通过之后,找不到对应的文件
}