拒绝用户“username”@“localhost”的访问,即使我更改了用户设置

bybem2ql  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(182)
<?php

 $db = mysqli_connect('localhost','root','','firstdb')
 or die('Error connecting to MySQL server.');

?>

<html>
 <head>
 </head>
 <body>
 <h1>PHP connect to MySQL</h1>
</body>
</html>

尽管错误为“拒绝访问用户'username'@'localhost'”,但我似乎无法访问我的文件,因为我对没有密码的根用户的访问被拒绝。
我也试着用用户名“username”创建一个用户,但根本不起作用。

svgewumm

svgewumm1#

代码没有问题。
我正在编辑一个php文件,其文件名与我尝试连接的文件名相同

相关问题