Bonjour,

Voila je rencontre un petit problème, j'ai suivi le tutoriel pour installer Apache, PHP, MySQL sur Mac (https://www.grafikart.fr/tutoriels/mac-os/yosemite-apache-php-mysql-524) mais voila une fois tout configurer j'essaie de connecter a sequel et le message d'erreur suivant apparait :

Impossible de se connecter à l'hôte 127.0.0.1 car l'accès a été refusé.

Vérifiez votre nom d'utilisateur ainsi que votre mot de passe et assurez vous d'avoir les droits d'accès suffisants.

MySQL a retourné : Access denied for user 'root'@'localhost' (using password: YES)

J'ai aussi essayer avec phpMyAdmin et la un autre message d'erreur :

mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)

merci d'avance.

9 réponses


Salut,

Tu as mis quoi comme mot de passe ? Par defaut c'est root.

J'ai mis root oui.

Essaye ça :

mysql -u root

mysql> USE mysql;
mysql> UPDATE user SET password=PASSWORD("NEWPASSWORD") WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

J'ai essayer de taper ça mais quand je tape :

mysql -u root

le message suivant s'affiche :

ERROR 1045 (28000): Access denied for user 'nicolasbressy'@'localhost' (using password: NO)

et par contre quand j'ai installé MySQL ce message est apparu a la fin de l'installation

2016-09-01T15:49:26.659110Z 1 [Note] A temporary password is generated for root@localhost: k!DsUferY8RL

If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.

Et pour info c'est pas la meme version de laravel que dans la video c'est laravel 5 que j'ai installé.

Bonsoir.
Ton problème va être résolu alors, vu que tu dois utiliser un mot de passe et qu'il t'es renseigné dans le message retourné à la fin de l'installation de MySQL.

Bonsoir, et non justement quand je met se mot de passe dans le fichier database.php ca change rien et quand j'essai de me conecter a phpMyAdmin non plus, c'est pour sa que je ne comprend pas trop la.

Et voila les erreurs quand je connecte a localhost/your-project-name/public/salut

PDOException in Connector.php line 55:
SQLSTATE[HY000] [2002] No such file or directory

in Connector.php line 55
at PDO->__construct('mysql:host=localhost;port=3306;dbname=test', 'root', 'k!DsUferY8RL', array('0', '2', '0', false, false)) in Connector.php line 55
at Connector->createConnection('mysql:host=localhost;port=3306;dbname=test', array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'test', 'username' => 'root', 'password' => 'k!DsUferY8RL', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'engine' => null, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 24
at MySqlConnector->connect(array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'test', 'username' => 'root', 'password' => 'k!DsUferY8RL', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'engine' => null, 'name' => 'mysql')) in ConnectionFactory.php line 61
at ConnectionFactory->Illuminate\Database\Connectors\{closure}()
at call_user_func(object(Closure)) in Connection.php line 924
at Connection->getPdo() in Connection.php line 792
at Connection->reconnectIfMissingConnection() in Connection.php line 677
at Connection->run('select * from `posts`', array(), object(Closure)) in Connection.php line 349
at Connection->select('select * from `posts`', array(), true) in Builder.php line 1610
at Builder->runSelect() in Builder.php line 1596
at Builder->get() in routes.php line 19
at RouteServiceProvider->{closure}()
at call_user_func_array(object(Closure), array()) in Route.php line 158
at Route->runCallable(object(Request)) in Route.php line 137
at Route->run(object(Request)) in Router.php line 724
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 726
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699
at Router->dispatchToRoute(object(Request)) in Router.php line 675
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 54

Essaye alors de refaire une installation

C'est se que j'ai fait j'ai restauré mon ordinateur car il etait trop lent donc jai tout recommencer de zero, tout le long de la video tout marche nickel sauf quand je met mysql.

Dans ce cas, je te conseil d'utiliser Vagrant ou de faire un dualboot avec un un vrai OS, un linux (Debian de préférence) ^_^

Plus sérieusement, je ne comprends pas, si à la fin de l'installation il te donne un mot de passe et que celui là n'est pas le bon c'est très bizarre ...