修改账号密码
http://www.jb51.net/article/39454.htm
分配账号和权限
grant select on wind.* to 'wind'@'%' identified by '!@#123abc';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 密码等级不够
show variables like 'validate%'
grant select on wind.* to 'wind'@'%' identfied by 'Wind2017!@#';
flush tables|logs|privileges;
insert into mysql.user(Host,User,Password) values("localhost","phplamp",password("1234"));
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
DELETE FROM user WHERE User="phplamp" and Host="localhost";
update mysql.user set password=password('新密码') where User="phplamp" and Host="localhost";
连表更新
update hangye_obj o left join hangye h on substr(h.code,1,4)=substr(o.hid,1,4) set o.hid=h.id