


WordPress Security
でも書いたように
Your table prefix should not be wp_. Click here to change it.
と警告してくれていたのだが、まだ対処していなかったので「怖いけどちょっとやってみるか」って感じで行った顛末記
作業そのものは簡単でWP Security Scanの[Security]メニューから[Database]を選ぶと変更できる
WP – Database Security
Make a backup of your database before using this tool:
Change your database table prefix to mitigate zero-day SQL Injection attacks.
Before running this script:
wp-config must be set to writable before running this script.
the database user you’re using with WordPress must have ALTER rights
Change the current:wp_ prefix to something different if it’s the default wp_
Allowed Chars are all latin Alphanumeric Chars as well as the Chars – and _.[Start Renaming]
wp_のところに新たなprefixを指定して[Start Renaming]をクリックすれば作業そのものは終了する
で、アクセスするとページは閲覧できて一安心。じゃ、ログインするかとアクセスするとゲゲ
このページにアクセスするための十分なアクセス権がありません
ログインできない(^_^;!
googleさんにお願いするとありました
WordPress のテーブルプレフィクスを変更する時の注意点
http://c-brains.jp/blog/wsg/08/11/13-213059.php
原因は「変更前のプレフィクス(’wp_’)を使用したデータが、データベース内に存在してしまっているからです。」とのことなので注意深く作業を行う
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[root@ns ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 194 Server version: 5.0.45 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use wpdb_MySitei; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> UPDATE rl_options SET option_name = 'ab_user_roles' WHERE option_name = 'wp_user_roles'; Query OK, 0 rows affected (0.03 sec) Rows matched: 0 Changed: 0 Warnings: 0 mysql> UPDATE rl_usermeta SET meta_key = 'ab_capabilities' WHERE meta_key = 'wp_capabilities'; Query OK, 2 rows affected (0.00 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> UPDATE rl_usermeta SET meta_key = 'ab_user_level' WHERE meta_key = 'wp_user_level'; Query OK, 0 rows affected (0.00 sec) Rows matched: 0 Changed: 0 Warnings: 0 mysql>quit |
無事にダッシュボードが開いて「よかったぁ~」。kimotoさん有り難う御座います
あれっ? 何か変?
プラグインのWassUpが動作していない!
phpを眺めたものの理解できるはずもなくプラグインを停止、起動するとSuccess create/update dbだって。いままでのデータは消えた!
まぁ、たかだか数日だからいいけど・・・
でも気になるのでMySqlのテーブルを眺めると
1 2 3 4 5 6 7 8 9 10 |
mysql> show tables; +------------------------+ | Tables_in_wpdb_MySite | +------------------------+ | ab_wassup | | ab_wassup_tmp | | wp_wassup | | wp_wassup_tmp | +------------------------+ 20 rows in set (0.00 sec) |
な状態に・・。これはてっきりWP Security Scan がtable_prefixを変更する時にデフォルトなテーブルのみを変更してプラグインが作成したテーブルは無視したのではと思ったのであります
そこで、
- プラグインを停止
- テーブルab_wassup, ab_wassup_tmpを削除
- wp_wassup, wp_wassup_tmp を ab_wassup, ab_wassup_tmp に変更
1 2 3 4 5 6 7 8 |
mysql> show tables; +------------------------+ | Tables_in_wpdb_MySite | +------------------------+ | ab_wassup | | ab_wassup_tmp | +------------------------+ 20 rows in set (0.00 sec) |
これでよし・・・プラグインを起動するとまたまたSuccess create/update dbだって。データは初期化されていた(^_^;;
で、分かったこと
- WP Security Scanは全てのテーブルのtable_prefixを変更する
- WassUpが使用するテーブルはwp_wassup, wp_wassup_tmpで固定。wp-config.phpの$table_prefixを参照していない
取り敢ずWassUpのデータは無くなりました(笑)