What is the database host name?


#1

I face database Host name error and can’t connect to my sql database on 000webhost i use this but can’t working
https://databases.000webhost.com/


#2

Database host name is localhost if you are using the new panel old panel is whatever server you are on.


#3

Tried to connect database with host name localhost , not being able to connect, so what is IP address of my host and how I could connect to this


#4

What is your site?
:slight_smile:


#5

I have the same problem. I am using the new panel. Please check my coding below. Is it correct?

<?php
    $dbhost = 'localhost';
    $dbuser = 'admin';
    $dbpass = 'abc123';
    $conn = mysqli_connect($dbhost, $dbuser, $dbpass) or die ('Database connection problem.');
?>

Thank you.


#6

Hi Admin,
Seems like I can not able to get connected with database server.
I want to know server name (mysql).
I tried databases.000webhost.com but connection failed error.


#7

My website is vishalkumar.000webhostapp.com and tried with this code

 $db_host = "localhost"; //hostname
    $db_user = "xyz"; // username
    $db_password = "xyz"; // password
    $db_name = "xyzl"; //database name 

So need to being able to connect with this host name localhost


#8

Hi James,
My website is vishalkumar.000webhostapp.com and tried with this code

 $db_host = "localhost"; //hostname
    $db_user = "xyz"; // username
    $db_password = "xyz"; // password
    $db_name = "xyzl"; //database name 

So need to being able to connect with this host name localhost, its givin[quote=“James, post:4, topic:40460, full:true”]
What is your site?
:slight_smile:
[/quote]

g 500 server error
[/quote]


#9

Thanks, servername= “localhost” is working for the new panel.
Visit here. Just have fun digital marketing.


#10