普通网友 2018-07-14 13:46
浏览 27

如何在namecheap php中创建数据库连接文件

<?php
    $dbHost="localhost";
    $dbUser="root";
    $dbPassword="";
    $dbName="registration";

    $dbcon=mysqli_connect($dbHost,$dbUser,$dbPassword,$dbName)
         or
             die("Connection failed: ".mysqli_connect_error());
?>

This is my db connection file I use in localhost, but now I am using web hosting using namecheap hosting and my site has registration and admin logging. I filled out the registration file but I have an error message:

"Connection failed: Access denied for user 'root'@'localhost' (using password: NO)"

The same error appeared in the log for the admin.php page.

  • 写回答

0条回答 默认 最新

    报告相同问题?