随笔分类 - MySQL
摘要:mysql 快清表中的数据 DELIMITER // CREATE PROCEDURE EmptyTables2() BEGIN DECLARE i INT DEFAULT 0; WHILE i < 65 DO SET @sql = CONCAT('TRUNCATE TABLE fileowner_
阅读全文
摘要:mysql 5.7启动报错: 2024-05-19T02:02:14.453082Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timesta
阅读全文
摘要:解决方法: 下载 Visual C++ Redistributable Packages for Visual Studio 2013 https://www.microsoft.com/zh-cn/download/details.aspx?id=40784 Visual C++ Redistri
阅读全文
摘要:Sun Apr 16 08:15:36 CST 2023There was an unexpected error (type=Internal Server Error, status=500).PreparedStatementCallback; SQL [select userId from
阅读全文
摘要:Mysql5+处理办法: mysql -hlocalhost -uroot -pgrant all privileges on *.* to root@"%" identified by ".";flush privileges;Mysql8+处理办法: mysql -hlocalhost -uro
阅读全文
摘要:Innodb中监控阻塞 select b.trx_mysql_thread_id AS'被阻塞线程' ,b.trx_query AS '被阻塞SQL' ,c.trx_mysql_thread_id AS '阻塞线程' ,c.trx_query AS '阻塞SQL' ,(UNIX_TIMESTAMP(
阅读全文
摘要:C:\WINDOWS\system32>D:\SOFTWARE\mysql-5.7.33-winx64\bin\mysql --port=7506 -uroot --password=pwd < D:\SOFTWARE\mysql-5.7.33-winx64\20220910bak\20220910
阅读全文
摘要:1、主库创建同步账号 #创建复制账号 CREATE User 'sync1' @'%' identified by 'Sync1'; #授权复制账号权限 GRANT REPLICATION SLAVE ON *.* TO 'sync1'@'%' identified by 'Sync1';#http
阅读全文
摘要:-- 查询表注释 select table_schema, table_name, table_comment from information_schema.tables where table_schema = '数据库名' and table_name = '表名'; -- 查询表字段注释 s
阅读全文
摘要:问题一: 1129 - Host '192.168.1.10' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法:mysqladmin -uroot -P7506 -pte
阅读全文
摘要:端口替换.bat @echo off Setlocal enabledelayedexpansion SET FIND_DIR=%~dp0 set st=7506 ::把替换字符串赋值给dt,这里举例是st->dt set dt=4506 ::循环bat文件只取文件名将文件名设置到s变量上 for
阅读全文
摘要:备份数据库.bat @setlocal enabledelayedexpansion @echo off color f0 title 备份数据库 rem 下面为自定义参数可修改 set mysqlServiceName=MySQL4506 set mysqlPort=4506 set rootUs
阅读全文
摘要:生成Mysql连接SSL证书.bat: @setlocal enabledelayedexpansion @echo off color f0 @REM 生成证书(前提是安装了oponssl) title 生成Mysql连接SSL证书 rem 下面为自定义参数可修改 set basedir=%~dp
阅读全文
摘要:Mysql5.7:下载地址 初始my.ini @setlocal enabledelayedexpansion @echo off color f0 rem 阿里云主机服务器。 title MYSQL已安装 rem 下面为自定义参数可修改 set mysqlServiceName=MySQL7506
阅读全文
摘要:@setlocal enabledelayedexpansion @echo off color f0 title 卸载指定服务 rem 下面为自定义参数可修改 set mysqlServiceName=MySQL7506 SC QUERY %mysqlServiceName% > NUL IF E
阅读全文
摘要:原理:停止服务,通过脚本程序添加skip-grant-tables配置,生成修改密码脚本,执行修改密码脚本,成功后停止服务,再通过脚本程序注释skip-grant-tables配置,最后再启动服务 脚本下载 前置脚本1:SkipGrantTablesInsert.bat (添加:skip-grant
阅读全文
摘要:问题:mysql skip-grant-tables 无法启动 解决方法: 在 my.ini 文件中加入 log-error=E:\WebData\mysql-5.7.33-winx64\\log\\mysqld.log 然后启动,会报错,然后查看ERROR的错误日志 我的提示是 2021-12-1
阅读全文
摘要:connection lost:The server closed the connection 其实很简单.mysql有个机制,就是8小时无通信,myslq就会自动关闭数据; 解决方案(2选1): 或者: 1.定时去做一个查询,就是 select * from XXX; 或者: 2.修改配置文件:
阅读全文