phpmyadmin - syntax error for changing user role from database

I want to change user role from the database, UPDATE wp_usermetaSET meta_value = 'a:1:{s:10:"subscriber"

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745452009a4628314.html

相关推荐

  • phpmyadmin - syntax error for changing user role from database

    I want to change user role from the database, UPDATE wp_usermetaSET meta_value = 'a:1:{s:10:"subscriber"

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信