0

I hope I'm being clear here, I don't 100% understand everything that's going on.

I created a database in MySQLWorkbench. I made the root user's password root as well.

I'm volunteering for a project outside of school, and I'm trying to get the thing up and running. I'm trying to connect the database to the application.

I use the comman "php artisan migrate" and am given this error:

Illuminate\Database\QueryException  : SQLSTATE[HY000] [1045] Access 
denied for user 'localhost'@'localhost' (using password: YES) (SQL: 
select * from information_schema.tables where table_schema = cmr 
and table_name = migrations and table_type = 'BASE TABLE')

And I receive these 2 exception traces:

1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'localhost'@'localhost' (using password: YES)")
      /Users/jimmyblundell1/Desktop/cmr/cmr-clinic-admin-api/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31

2   PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'localhost'@'localhost' (using password: YES)")
      /Users/jimmyblundell1/Desktop/cmr/cmr-clinic-admin-api/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

I have ensured that the .env file in the project contains all the appropriate information for my database.

I was able to get the database to successfully be loaded before. I was using phpMyAdmin in MAMP, and I manually changed the user's password from there. When I ran 'php artisan migrate' this time, all the tables were successully loaded into the database. However, phpMyAdmin then proceeds to lock me out. In order to avoid this headache, I was just trying to stick with MySQLWorkbench.

EDITS: I'm using a Mac.

I can log in from the command line using mysql -uroot -proot mysql

I found out the problem -- I had my database name wrong the whole time.

kastaplastislife
  • 293
  • 2
  • 16

0 Answers0