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
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire