嗨我更改mysql用戶密碼使用波紋管腳本但密碼不會更改。如何更改mysql用戶密碼?
$conn = mysqli_connect('host', 'root', 'password');
$dbUser = "username"; # same username as in your example
$dbPass = "new_password"; # new password
$queries = array(
"USE mysql;", # switch to the 'mysql' database
"SET PASSWORD FOR '$dbUser'@'localhost' = PASSWORD('$dbPass');"
);
foreach($queries as $query) {
$rs = mysqli_query($conn, $query);
}
使用此腳本密碼不會更改,也不會顯示錯誤。
你有些進步嗎? – 2015-05-01 18:50:18