1.sql命令替换字符串方法
update giftvote_item set img1 = REPLACE(img1,'http://te1ad213fasdf.qq.zlcm8.com','http://twhfdsg.sf3rs.douxueyuan.xyz') where img1 like 'http://te1ad213fasdf.qq.zlcm8.com%';
如上,对 giftvote_item表中img1字段进行update操作,将字符串中
http://te1ad213fasdf.qq.zlcm8.com/8f86f9d55d314720a2adac37973b7b4f
替换为:
http://twhfdsg.sf3rs.douxueyuan.xyz/8f86f9d55d314720a2adac37973b7b4f
------------------------------------------------------------------------------
2.sql命令修改root密码(mysql 5.7.221)
update mysql.user set authentication_string=password('123456') where user='root' ;
flush privileges;
3.mysql给root开启远程访问权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.2.1' IDENTIFIED BY '6c02d1f2426b2aca';
flush privileges;
本文介绍三种实用的SQL命令:字符串替换、更新root密码及开启远程访问权限,适用于MySQL5.7.22版本,帮助数据库管理员高效管理数据库。
696

被折叠的 条评论
为什么被折叠?



