samedi 27 mai 2017

How to solve mysql error: Access denied for user 'root'@'localhost'

I have this simple php script:

<?php
$c = new mysqli("localhost", 'root', '');
echo($c->connect_error);
?>

My mysql credentials are correct but when I run the php script, it prints this error: Access denied for user 'root'@'localhost'. I started mysql and apache services using service mysql start and service apache2 start. When I type mysql -u root -h localhost on terminal, all goes well but not my script. I tried using laravel but still getting the same error. What am I doing wrong? Please help. Regards



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2r66FMj
via IFTTT

Aucun commentaire:

Enregistrer un commentaire