我在 MySQL 数据库中有一个包含以下列的表
[id, url]
网址如下:
http://domain1.example/images/img1.jpg
我想将所有 URL 更新到另一个域
http://domain2.example/otherfolder/img1.jpg
保持文件名不变。
我必须运行什么查询?
最佳答案
UPDATE urls
SET url = REPLACE(url, 'domain1.example/images/', 'domain2.example/otherfolder/')
https://stackoverflow.com/questions/10177208/
相关文章:
mysql - 错误 2006 (HY000) : MySQL server has gone aw
mysql - 我应该使用什么列类型/长度将 Bcrypt 散列密码存储在数据库中?
mysql - 对于 Homebrew mysql 安装,my.cnf 在哪里?
mysql - 表 'performance_schema.session_variables' 不
mysql - 在 MySQL 数据库的每个表的字段中搜索文本
mysql - 在性能开始下降之前 MySQL 数据库可以有多大
mysql - 我应该如何解决 MySQL 中的 --secure-file-priv 问题?