简体   繁体   English

无法在活动服务器上连接我的数据库

[英]Can't connect my database on my live server

Hello I've been making a site on my local server and I finished it so I'm moving everything over to my live server. 您好,我已经在本地服务器上建立了一个网站,并完成了工作,因此我将所有内容都移到了实时服务器上。 I've made a database in phpmyadmin on it and I would like to connect to it. 我已经在phpmyadmin上建立了一个数据库,我想连接到它。 I feel like I have the wrong inputs though because it gives me this error. 我感觉输入有误,因为它给了我这个错误。

在此处输入图片说明

This is my code for my database connection. 这是我的数据库连接代码。

<?php

return $conn = mysqli_connect('localhost', 'gener105_nate', '(Password)', 'user_data');

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

I didn't actually enter password I just think I shouldn't show it anyway I think I just have something mixed up since I'm new at this. 我实际上并没有输入密码,我只是想无论如何都不应该显示密码,因为我是新来的人,所以我只是觉得有些混乱。

Oh and the database is located within a database grouping should i input the path to it? 哦,数据库位于数据库分组中,我应该输入它的路径吗?

在此处输入图片说明

您需要告诉它连接到gener105_user_data,而不只是user_data

return $conn = mysqli_connect('localhost', 'gener105_nate', '(Password)', 'gener105_user_data');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM