#1.创建账号并授权 GRANT REPLICATION SLAVE ON *.* TO backup@'%' IDENTIFIED BY 'backup'; flush privileges; #2.锁表 FLUSH TABLES WITH READ LOCK; #3.查看当前状态 show master status;
1、update update table name set guarantee_id ='34' and guarantee_name = 'xxxx’ where demand_id = 1567; 2、insert into insert into table(field1,field2) values(value1,value2) 3、delete delete from table where 范围
-- select * from t_web_001_member where DATE(regtime) = '2017-09-13' and memberId > 165949; select * from t_web_001_member where DATE(regtime) = '2017-09-12'; -- select * from t_web_001_member where DATE(regtime) = '2017-09-13' and memberId > 165949;
-- UPDATE t_web_001_member set regtime= DATE_FORMAT(ADDDATE(date_sub('2017-09-12 07:00:00',interval 0 day) , INTERVAL FLOOR(0 + RAND() * 120) MINUTE),'%Y-%m-%d %H:%i:%s') where DATE(regtime) = '2017-09-13' and memberId > 165949
insert into INSERT INTO t_web_001_member(userName, mobile, loginpwd,regtime,mobile_state, isAccountIn) SELECT username, mobile, PASSWORD, create_time,1, 1 FROM t_user;
清空某列的数据 update t_web_001_member set regtime =null;
权限
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
5.7设置root密码 update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
create database zabbix charset utf8; create database car charset utf8; grant all privileges on car.* to 'car'@'%' identified by 'xxxxxx'; flush privileges;
#给普通用户建库的权限 grant select,delete,update,create,drop,alter,insert on *.* to 'xx'@'%' ;