テーブルプレフィックスを変更して DB をインポートした場合、(wp_)option、(wp_)usermeta テーブルを修正してやらないとアクセス権無しでログインできなくなる。
テーブルプレフィックスを wp_ から wp_other_ に変更した場合に修正するための SQL 文。
UPDATE wp_other_options SET option_name = 'wp_other_user_roles' WHERE option_name = 'wp_user_roles';
UPDATE wp_other_usermeta SET meta_key = 'wp_other_capabilities' WHERE meta_key = 'wp_capabilities';
UPDATE wp_other_usermeta SET meta_key = 'wp_other_dashboard_quick_press_last_post_id' WHERE meta_key = 'wp_dashboard_quick_press_last_post_id';
UPDATE wp_other_usermeta SET meta_key = 'wp_other_user-settings' WHERE meta_key = 'wp_user-settings';
UPDATE wp_other_usermeta SET meta_key = 'wp_other_user-settings-time' WHERE meta_key = 'wp_user-settings-time';
UPDATE wp_other_usermeta SET meta_key = 'wp_other_user_level' WHERE meta_key = 'wp_user_level';
コメントを残す