快讯资讯
手机优化
系统数码
网络通信人工智能
网站游戏
测评专题

  CentOS下MySQL 5.7编译安装       Apache mod_deflate压缩模块    

Mysql的replace函数替换字符串

时间:2026-09-10 00:12 来源:未知 人气:

要把数据库中某个列的所有值中含有”test.linuxeye.com”的字符更换成”www.linuxeye.com”,方法有几种,如shell脚本,但是这样效率非常低,google了几把,发现Mysql中有replace函数很容易实现替换。

replace(str,from_str,to_str) 在字符串 str 中所有出现的字符串 from_str 均被to_str替换,然后返回这个字符串

如你要将表wp_posts里面的guid字段的http://test.linuxeye.com/…替换为http://www.linuxeye.com/…: update wp_posts set guid=replace(guid,’http://test.linuxeye.com/’,'http://www.linuxeye.com/’);

Tue Mar 5 15:12:42 CST 2013

本文标签:

更多文章

相关文章

网站导航 | 快讯 | 资讯 | 手机 | 优化

  • 数码 | 网络通信 | 人工智能 | 网站 | 游戏

    合作伙伴:

  • 友情链接(欢迎业界知名网站交换链接)申请友情

    

    声明:本站资源皆来自网络,如有侵权问题,请联系管理员处理!

    Copyright ©2020-2028快知站 版权所有 All rights reserved.

    闽ICP备20010713号-1 闽公网安备 35020602001684号