无法连接到数据库。 我的错误:在我的代码错误,但我无法找出如何修复
[Sat Jul 29 23:02:56.747139 2017] [proxy_fcgi:error] [pid 13049:tid 140689614522112] [] AH01071: Got error 'PHP message: PHP Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'timavnl_1'@'localhost' (using password: YES) in /home/timavnl/domains/tim-av.nl/public_html/6628/job/db_connect.php on line 2\nPHP message: PHP Warning: mysqli::prepare(): Couldn't fetch mysqli in /home/timavnl/domains/tim-av.nl/public_html/6628/job/index.php on line 5\nPHP message: PHP Warning: main(): Couldn't fetch mysqli in /home/timavnl/domains/tim-av.nl/public_html/6628/job/index.php on line 10\nPHP message: PHP Notice: Trying to get property of non-object in /home/timavnl/domains/tim-av.nl/public_html/6628/job/index.php on line 23\nPHP message: PHP Fatal error: Call to a member function fetch() on null in /home/timavnl/domains/tim-av.nl/public_html/6628/job/index.php on line 24\n'
我的DB连接代码:
<?php
$db = new mysqli("localhost","timavnl_1","password"."timavnl_1") or
die("ERROR! With connection");
?>
的index.php代码: Picture of: index.php
的代码是好的,你有问题,数据库凭据。 – kuba
只是你的错误,这个问题是关于你试图创建一个连接到你的数据库 'PHP警告:mysqli :: mysqli():(HY000/1045):拒绝访问用户'timavnl_1'@'localhost'(使用密码:是)在/home/timavnl/domains/tim-av.nl/public_html/6628/job/db_connect.php在线2上 为什么你有这个错误?不知道没有代码,但它与你的凭据有关 – sheplu
这是至少有一打以前的问题在这里重复。请有礼貌地至少对*确切的错误信息做一个基本的搜索(通过Google或本网站)*您将看到在发布新问题之前是否有可用的解决方案。 –