thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

Error somewhere between parts 6-9: "mysqli_connect(): (HY000/1045): Access denied" #38

Open oijara opened 10 years ago

oijara commented 10 years ago
Hey guys, I thought I'd followed the tutorials pretty exactly, but I keep getting the following error(s) when I try and load localhost/series/dynamic/AtomCMS/:

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'dev'@'localhost' (using password: YES) in C:\server\htdocs\series\dynamic\AtomCMS\config\setup.php on line 5

Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\server\htdocs\series\dynamic\AtomCMS\config\setup.php on line 5 Could not connect because:

(there is no message after 'could not connect because:')

'setup.php' (changed the database password from 'thepassword1' to 'password'. Line 5 is the one which defines $dbc):

<?php // Setup file

a database connection here (part 6 of series)

$dbc = mysqli_connect('localhost', 'dev', 'password', 'atomcms') OR die('Could not connect because: '.mysqli_error());

$site_title = 'AtomCMS 2.0'; $page_title = 'Home Page';

?>

Pre-HTML portion of 'index.php':

<?php

include('config/setup.php'); 

$q = "SELECT * FROM pages WHERE id = 1";
$r = msqli_query($dbc, $q);

#part 9 of  series
$page = mysqli_fetch_assoc($r);

?>


Thanks for any tips and advice. Thanks, too, for the tutorials themselves -- they've been wonderfully helpful and very beginner-friendly!

thedigicraft commented 10 years ago

Hello! Thanks!

Take a look at the issue posted here and see if this fixes it:

Mysqli Permissions: https://github.com/thedigicraft/Atom.CMS/issues/1