gpt4 book ai didi

mysql - 警告 : mysql_query() [function. mysql-query]:用户 'a8004576' @'localhost' 的访问被拒绝(使用密码:NO)

转载 作者:行者123 更新时间:2023-11-29 03:04:45 24 4
gpt4 key购买 nike

我正在用 000webhost 为我的复古 Habbo 制作网站,我发现了这个错误

Warning: mysql_query() [function.mysql-query]: Access denied for user 'a8004576'@'localhost' (using password: NO) in /home/a8004576/public_html/global.php on line 25

第 25 行的脚本:

$server_statut_sql = mysql_query("SELECT users_online,rooms_loaded FROM server_status LIMIT 1") or die(mysql_error());
$server = mysql_fetch_assoc($server_statut_sql);
if ($page_ban != 1)
{
$verif_banip = mysql_query('SELECT value FROM bans WHERE value = "'.$_SERVER['REMOTE_ADDR'].'"');
if(mysql_num_rows($verif_banip) == 1){
Redi('banned');
}
}
if ($page_maintenance != 1) {
if ($maintenance == 1) {
Redi('maintenance');
}

这是我的mysql文件

    <?php
$username = "a800xxxxxx";
$password = "xxxxxxxxxxxxx";
$hostname = "mysql1.000webhost.com";

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";

//select a database to work with
$selected = mysql_select_db("a800xxxxxx",$dbhandle)
or die("PK TU FAIT CHIER SALE FDP");

//execute the SQL query and return records
$result = mysql_query("SELECT id, model,year FROM cars");

//fetch tha data from the database
while ($row = mysql_fetch_array($result)) {
echo "ID:".$row{'id'}." Name:".$row{'model'}."Year: ". //display the results
$row{'year'}."<br>";
}
//close the connection
mysql_close($dbhandle);
?>

最佳答案

您很可能忘记调用 mysql_connect(或包括调用它的脚本)。因此,对 mysql_query 的第一次调用尝试使用(不完整的)自动信息登录并失败。提示是错误消息通常是在提供无效凭据时由 mysql_connect 返回的错误消息,但它来自 mysql_query。

关于mysql - 警告 : mysql_query() [function. mysql-query]:用户 'a8004576' @'localhost' 的访问被拒绝(使用密码:NO),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17579178/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com