1、in 条件排序SELECT * from `users` where `id` in (26612,26611,26610) order by field(id,26612,26611,26610); 2、mysqldump: Got error: 1356 mysqldumpmysql表删除,视图未关联删除报错! mysqldump: Got error: 1356: View 'Student.v_score' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them when using LOCK TABLES 解决方法:$mysqldump -ubkpuser -ps3cret --force wordpress >wordpress1.sql 3、mysql去除小数点后面0将0.2000转换为0.2 mysql> select 0 + CAST(0.20000 AS CHAR ); 4、解决sql_mode=only_full_group_bymysql 5.7 版本及以上版本会出现的问题: 解决方法: 在my.ini配置文件添加[mysqld]下面添加 sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 5、jdbc连接mysql报错:The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration。解决方法: 完整的连接字符串示例:jdbc:mysql://localhost:3306/test?serverTimezone=UTC 或者还有另一种选择:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8,这个是解决中文乱码输入问题,当然也可以和上面的一起结合:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC |
|