UPDATE master SET username=REPLACE(username,'admin','zhiqiang'); 把master表 username字段的所有admin替换成zhiqi...
让mysql的自增ID连续起来
WP博客有自动草稿和历史版本,导致文章ID断断续续,中间很多没法利用起来,所以找了下,发现自增ID复位主要有两个方案; 方案一是直接清空表 TRUNCATE TABLE tablename; 当然,我...
mysql 8.0重置用户密码skip-grant-tables
使用skip-grant-tables 模式 1. UPDATE mysql.user SET authentication_string=null WHERE User='root'; 2. FLU...
phalcon中模型NOT-NULL字段不能为NULL
在phalcon中model字段设置了not null在使用时候自动设置为空字符串或者0. 我们需要写一个监听方法beforeValidation框架底层会自动调用。 <?php /*...
You must reset your password using ALTER USER statement before executing this statement.
ALTER USER root@localhost IDENTIFIED BY "newpassword"
更换group_concat函数的分隔符
SELECT GROUP_CONCAT(nickname SEPARATOR '|') FROM `user` group by gender;
mysql按年月周日分组统计
$groupBy = '%Y%m%d'; //按日 if ($cycle == 'week') $groupBy = '%Y%u'; //按周 if ($cycle == 'month') $grou...
innodb性能优化配置关键项
innodb_buffer_pool_size=8G innodb_log_file_size=256M innodb_flush_log_at_trx_commit=2 innodb_flush_m...
mysql从库同步出错解决方法
忽略错误: slave-skip-errors=1062
Error while sending QUERY packet
SHOW VARIABLES LIKE 'max_allowed_packet'; SET GLOBAL max_allowed_packet=524288000;