连接失败:用户'i366059'@'192.168.XX.XX'拒绝访问(使用密码:是)

时间:2017-05-10 19:20:12

标签: php mysql

我正在尝试在phpMyAdmin中将用户注册到我的数据库,但是当我输入他的详细信息时,我收到消息“连接失败:访问被拒绝用户'i366059'@'192.168.XX.XX'(使用密码:是)“

我在phpMyAdmin中创建了数据库,其中包含保存信息所需的字段。我有一些带有PHP代码的文件夹,可以将它发送到数据库。

这是我的注册php:

    <?php

    $activeHome="";
    $activeCourse = "";
    $activeVisit = "";
    $activeContact = 'active';
    $content = '<div style="height: 1100px" id="content">
                    <a href="index.php"><img id="topPicture" src="img/header.jpg"></a>
                    <p>Please enter your information to create a new account</p>
                    <form action="signup.php" method="POST">
                      <br>First name<br>
                      <input type="text" name="first" placeholder="First name">
                      <br>Last name<br>
                      <input type="text" name="last" placeholder="Last name">
                      <br>User name<br>
                      <input type="text" name="uid" placeholder="User name">
                      <br>Password<br>
                      <input type="password" name="pwd" placeholder="Choose a password"><br><br>
                      <button type="submit">Sign up now</button>
                    </form>
                </div>';
include 'template.php';

我的注册php:

<?php
session_start();
include 'dbh.php';

$first = $_POST['first'];
$last = $_POST['last'];
$uid = $_POST['uid'];
$pwd = $_POST['pwd'];

$sql = "INSERT INTO user1 (first_name, last_name, uid, pwd)
VALUES ('$first', '$last', '$uid', '$pwd')";
$result = $conn->query($sql);

header("Location: registered.php");

和我的dbh.php://我的数据库信息是

<?php
$conn = mysqli_connect("studmysql01.fhict.local","i366XXX","rus876XXXX","dbi366XXX");

if (!$conn) {
  die("Connection failed: ".mysqli_connect_error());
}

0 个答案:

没有答案
相关问题