1、在执行select查询的时候遇到如下问题:
ERROR
1064 (
42000): You have
an error
in your SQL syntax; check
the manual that corresponds
to your MySQL server
version for the right syntax
to use near ***
后经查证,是数据表中的一个字段与mysql的关键字相同导致,在语句中使用该字段时需要加反冒号,即key的方式;
2、int类型可以设置 default,但不可以设置为default ”;
3、在某些情况下,强制使用索引(force index(*))是能够极大的提高查询效率的;
4、show full processlist可以查看查询的当前状态;
5、show status like 'Last_query_cost'可以查看上一条执行的sql语句的查询成本(需要查找多少个数据页);
6、有高并发的情况时,设置增大最大连接数set global max_connections=5000;
转载请注明原文地址: https://ju.6miu.com/read-12053.html