MySQL REPLACE 语句不对吗?“找到一条新语句,但没有分隔符"

2022-01-05 00:00:00 mysql phpmyadmin

我正在尝试替换表字段中的子字符串,但 phpMyAdmin 说找到了一条新语句,但它与前一条语句之间没有分隔符'(REPLACE 附近)"我已经翻阅了文档,但没有发现我可以做什么的提示.此外,网络搜索不会产生有用的结果......

I'm trying to replace substrings in the fields of a table, but phpMyAdmin says "A new statement was found, but no delimiter between it and the previous one' (near REPLACE)" I've digged through the documentation, but found no hint on what I could do. Also, a web search doesn't yield helpful results...

我的声明:

update phpbb_users
SET user_avatar = REPLACE(user_avatar, 'http://', '//') WHERE user_avatar LIKE ('http://%');

我在尝试使用

update phpbb_posts
SET post_text = REPLACE(post_text, 'http://', '//') WHERE post_text LIKE ('http://');

推荐答案

这个 似乎是一个那个(过时的)phpMyAdmin 版本的错误;它至少在当前的 4.5.5.1 中得到修复,可能更早,但我没有进行广泛的测试以找到确切的时间.

This appears to have been a bug with that (outdated) phpMyAdmin version; it's fixed at least in the current 4.5.5.1, possibly earlier but I didn't test extensively to find when exactly.

相关文章