Click here to Skip to main content
16,021,293 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an errors

Warning: mysql_connect(): Access denied for user 'evert_padje'@'localhost' (using password: YES) in C:\xampp\htdocs\forum\connect.php on line 9
Error: could not establish database connection


What I have tried:

<?php 
session_start();

$server	    = "localhost";
$username	= "root";
$password	= "";
$database	= "dbform";

if(!mysql_connect($server, $username, $password))
{
 	exit('Error: could not establish database connection');
}
if(!mysql_select_db($database))
{
 	exit('Error: could not select the database');
}
?>
Posted
Updated 5-Mar-17 22:19pm

1 solution

We can't solve this: We have no access to your DB.
So start with your computer and check what your MySql instance is expecting in terms of login: because that code doesn't match the error message. The code specifies "root" with a blank password (which is dangerous enough) by the error refers to the user name as "evert_padje" ...
 
Share this answer
 
Comments
Jim Clinton 6-Mar-17 4:25am    
I used this code from this website

https://code.tutsplus.com/tutorials/how-to-create-a-phpmysql-powered-forum-from-scratch--net-10188
OriginalGriff 6-Mar-17 4:34am    
And you are supposed to try to understand it, not just fill in values and hope... :laugh:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900