【原创】 mysql系统存在Metadata Lock
                                07
                                03月
                                2023
                            
                             看这些办法1.查看当前存在的事务。select*frominformation_schema.INNODB_TRX\G;2.查看当前事务执行时间,如果某个事务执行了很长时间,可能就是有问题的那个。selectid,timefrominformation_schema.PROCESSLISTwhereidin(selecttrx_mysql_thread_idfrominformation_schema.INNODB_TRX)3.查看当前事务正在执行的语句。#我们可以借助performance_schema.events_statements_current,该表可以看到会话对应的sql。SEL...
                                
                                看这些办法1.查看当前存在的事务。select*frominformation_schema.INNODB_TRX\G;2.查看当前事务执行时间,如果某个事务执行了很长时间,可能就是有问题的那个。selectid,timefrominformation_schema.PROCESSLISTwhereidin(selecttrx_mysql_thread_idfrominformation_schema.INNODB_TRX)3.查看当前事务正在执行的语句。#我们可以借助performance_schema.events_statements_current,该表可以看到会话对应的sql。SEL...                            【原创】 mysql查询语句导出到excel等文件
                                22
                                12月
                                2021
                            
                            .jpeg) 加表头导出select*from(select'id','用户名称','密码'unionallselectid,user_name,passwordfromctrl_user)bintooutfile'/public/excel/export/ctrl_user.xlsx'fieldsterminatedby','linesterminatedby'';不加表头导出selectid,user_name,passwordfromctrl_userintooutfile'/public/excel/export/ctrl_user.xlsx'fieldsterminatedby','lineste...
                                
                                加表头导出select*from(select'id','用户名称','密码'unionallselectid,user_name,passwordfromctrl_user)bintooutfile'/public/excel/export/ctrl_user.xlsx'fieldsterminatedby','linesterminatedby'';不加表头导出selectid,user_name,passwordfromctrl_userintooutfile'/public/excel/export/ctrl_user.xlsx'fieldsterminatedby','lineste...                            【MySQL】in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
                                22
                                11月
                                2021
                            
                             出现这种情况,我通过了这种方式查看在MySQL终端中输入:SELECT@@GLOBAL.sql_mode;#得到如下记录
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION继续输入:SELECT@@SESSION.sql_mode;#得到吐下记录
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_D...
                                
                                出现这种情况,我通过了这种方式查看在MySQL终端中输入:SELECT@@GLOBAL.sql_mode;#得到如下记录
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION继续输入:SELECT@@SESSION.sql_mode;#得到吐下记录
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_D...                            【原创】 lnmp环境重置mysql数据库密码
                                29
                                04月
                                2021
                            
                            
                            
                            
                        mysql修改配置文件后重启报错Starting MySQL. ERROR! The server quit without updating PID file (/usr/local/mysql/var/10-46-8-213.pid)
                                29
                                12月
                                2018
                            
                            
                            
                            
                        mysql数据库设置默认字符集UTF8
                                28
                                11月
                                2018
                            
                            
                            
                            
                        mysql数据库误删binlog恢复
                                24
                                10月
                                2018
                            
                            
                            
                            
                        mysql 自动插入随机的时间
                                07
                                07月
                                2018
                            
                            
                            
                            
                        把mysql中某个字段部分数据替换掉
                                29
                                06月
                                2018
                            
                            
                            
                            
                        修改mysql密码
                                28
                                05月
                                2016
                            
                            
                            
                            
                         
                                 
                                 
                                 
                                