Connection Error

Hello admin,
My username is epiz_26135800.
my web name is
I test my web to create database by coding codes below.


$servername = "";

$username = "epiz_26135800";

$password = "HIDDEN BY MOD";

// Create connection

$conn = new mysqli($servername, $username, $password);

// Check connection

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);


// Create database


if ($conn->query($sql) === TRUE) {

echo "Database created successfully";

} else {

echo "Error creating database: " . $conn->error;




I test for my dynamic website.But not connect.Return error below.

Connection failed: Access denied for user ‘epiz_26135800’@‘’ (using password: YES)

What should I do.

Create database from PHPMYADMIN on cpanel, you cannot create it using php.


Basically what @anon19508339 said. Except for the fact that databases are created through the MySQL Databases section in the control panel, not phpMyAdmin.

Creating databases in phpMyAdmin requires either permissions to be setup beforehand, or administrative privileges. Since the database servers are shared among users, you don’t get root powers. So on any system where you don’t have the full database server, you’ll need to use the tools provided by the database operator to create the database schemas.


Thank you!

I suddenly wrote Phpmyadmin and you replied before i edit.
Btw thank you for letting me know.


I creatt database named as test.But not connect to MySQL.
Error message is also same as access denied .What should I do.

After that you can use this code to connect to your database:

$servername = "";
$username = "epiz_26135800";
$password = "********";
$dbname = "epiz_26135800_test";

$db = mysqli_connect($servername, $username, $password, $dbname);
if(!$db) echo "Connection failed: ".mysqli_connect_error();

replacing the asterisks with your hosting account password.


Please note that if you create a database schema with the name test, the full database name with be epiz_26135800_test. Database names are always prefixed with your account username. If you omit the username from the database name, you’ll also get an access denied error.


thank ypu so much for ansowing to me.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.