1,order by
order by 字段为varchar类型,当0,1,5,9,10,40时
排序为 0 1 10 40 5 9 10
若按数字顺序排列
解决方法:
order by varchar+0
2,查看MySQL进程
SHOW PROCESSLIST;
3,1129 - host '' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
原因:同一个ip在短时间内产生太多(超过mysql数据库max_connection_errors的最大值)中断的数据库连接而导致的阻塞;
解决:
远程登录数据库
mysql -h127.0.0.1 -P3306 -uroot -p
1),命令
mysql > flush hosts;
回车
2),配置文件
提高允许的max_connection_errors数量
a.进入Mysql数据库查看max_connection_errors: show variables like '%max_connection_errors%';
b.修改max_connection_errors的数量为1000: set global max_connect_errors = 1000;
c.查看是否修改成功:show variables like '%max_connection_errors%';