登录:
mysql -u*** -p***
查看,设置自增参数:
mysql> show variables like '%increment%';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| auto_increment_increment | 2 |
| auto_increment_offset | 1 |
| div_precision_increment | 4 |
| innodb_autoextend_increment | 64 |
+-----------------------------+-------+
set auto_increment_increment = 1和set @@auto_increment_increment = 1
如果想永久性的改回为1,在my.cnf or my.ini中查找这个field,然后修改,然后restart mysql.
(mysql包下面的 my.cnf)查找 my,cnf 文件: find ./ -name my.cnf
/mysql-init/mysql_vip_install/mysql/etc/my.cnf
(系统的 my.cnf ) : /etc/my.cnf
重启 mysql:
service mysql start/stop/restart 开关mysql
参考:https://blog.csdn.net/leqiwen/article/details/77262242
使用命令操作mysql:
修改时间:
https://www.cnblogs.com/chuanzhang053/p/9228798.html
date_add
update account set last_assigned_time = date_sub(last_assigned_time,INTERVAL '40' day) where account_id = 21285;
查询重复数据:
select * from 表1 o
where (o.&&) in (select && from 表1 where is_deleted = 0
group by && having count(*) > 1) and is_deleted = 0;