Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
Cake is NOT able to connect to the database.

Database connection "Mysql" is missing, or could not be created.
SQLSTATE[42000] [1044] Access denied for user ''@'localhost' to database 'database_name'


Above is the error message rise when i use Cake php and Mysql (in XAMPP)in windows 7

but i use simple code
PHP
<?php
// Create connection
$con=mysqli_connect("localhost","root","","database_name");

// Check connection
if (mysqli_connect_errno($con))
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
 else
  {
   echo "connected to MySQL " ;
  } 
?> 

[^] but this code worked fine ..
how can i connect to mysql database in cake php ?
i want connect database how it could be possible ?
Posted
Updated 13-Jul-13 16:36pm
v2
Comments
ZurdoDev 13-Jul-13 22:21pm    
What's the question? The error says it can't connect to the database the way you have told it to. You need to correct that.
[no name] 13-Jul-13 22:59pm    
Looks to me that you should try real user login credentials in your connection.

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