Answers:
关于cPanel和phpmyadmin我什么也不能说,但是总的来说,我可以通过编写一个简单的脚本来做到。
我为你写了一个shell脚本
#!/bin/bash
# mysql credential
user="root"
pass="root"
# list of all databases
all_dbs="$(mysql -u $user -p$pass -Bse 'show databases')"
for db in $all_dbs
do
if test $db != "information_schema"
then if test $db != "mysql"
then mysql -u$user -p$pass $db -sN -e "UPDATE wp_users SET user_pass = MD5('somepassword') WHERE user_login ='admin' LIMIT 1;"
fi
fi
done
尝试运行此命令,然后剪切n将输出粘贴回phpMyAdmin
SELECT CONCAT('UPDATE `',
schema_name, '`.\'wp_users\' SET \'user_pass\' = MD5(\'somepassword\') WHERE \'user_login\' =\'admin\' LIMIT 1;')
FROM information_schema.schemata
WHERE schema_name NOT IN ('information_schema','mysql','performance_schema','test');
或者,如果您能够在此服务器上安装代码,请通过Shlomi Noach 安装Common Schema并执行以下QueryScript
call common_schema.foreach( 'schema', "UPDATE `${schema}`.`wp_users` SET 'user_pass' = MD5('somepassword') WHERE 'user_login' ='admin' LIMIT 1");