-3

I'm using UniServerZ to run my PHP and have setup a database in PHPMyAdmin. Here is the PHP to connect to the database.

<?php
    $db = mysqli_connect('localhost','root','','easyfix');
    if(mysqli_connect_errno()){
       echo "Failed to connect to MYSQL: " . mysqli_connect_error();
    }
?>

However this gives the error in the title.

I've read other possible solutions on this but none seem to work. The database / user account is using default settings ~ I've changed nothing. What would be causing this error?

joe martin
  • 93
  • 1
  • 11
  • 3
    What part of 'access denied' is unclear? You're using credentials (root/no password) which are not valid for the database server. there's nothing to "fix" - get the proper credentials. – Marc B Oct 01 '15 at 15:09

1 Answers1

0

You can manage privileges from phpmyadmin. You need to check wich users you've created and from where this user can access to your database. Anyway root user without password is not a good idea.

Xarrainho
  • 1
  • 3