最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

phpmyadmin - syntax error for changing user role from database

programmeradmin2浏览0评论

I want to change user role from the database,

UPDATE wp_usermeta
SET meta_value = 'a:1:{s:10:"subscriber";b:1;}' 
WHERE meta_key = 'wp_capabilities' 
AND meta_value = 'a:1:{s:9:"wpas_user";b:1;}';

but I get an error.

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''a:1:{s:10:"subscriber")' at line 1

I want to change user role from the database,

UPDATE wp_usermeta
SET meta_value = 'a:1:{s:10:"subscriber";b:1;}' 
WHERE meta_key = 'wp_capabilities' 
AND meta_value = 'a:1:{s:9:"wpas_user";b:1;}';

but I get an error.

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''a:1:{s:10:"subscriber")' at line 1

Share Improve this question edited May 30, 2019 at 8:07 Jacob Peattie 44.2k10 gold badges50 silver badges64 bronze badges asked May 30, 2019 at 8:07 D.JCodeD.JCode 2013 silver badges12 bronze badges 3
  • Is that the exact code you're running? I didn't receive any error when I ran that query. – Jacob Peattie Commented May 30, 2019 at 8:09
  • sure http://s8.picofile/file/8362076834/ttttt.PNG – D.JCode Commented May 30, 2019 at 8:12
  • @JacobPeattie I found the problem. it cause two ;. how can I solve that? – D.JCode Commented May 30, 2019 at 8:27
Add a comment  | 

1 Answer 1

Reset to default 0

Found it.

It was a field in phpMyAdmin which is set to a semicolon(;) by default.

I have changed it to an unused char and the query ran normally.

发布评论

评论列表(0)

  1. 暂无评论