0

I'm using a MacbookPro M1. I am trying to run php artisan migrate, but it keeps giving me this error message.

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = library-app and table_name = migrations and table_type = 'BASE TABLE')

Here's my .env file

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=library-app
DB_USERNAME=root
DB_PASSWORD=password123

I tried looking everywhere on the Internet but to no avail. I need assistance since I have no more options.

Update: I tried changing DB_HOST=127.0.0.1 to localhost and it didn't do anything.

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
UkiyoE
  • 1
  • 1
  • Sounds like your application cannot properly connect to the database - did this work before? – Nico Haase Sep 22 '22 at 14:52
  • Yes in another project but I don't know why it's like this now. – UkiyoE Sep 22 '22 at 15:00
  • So where is your database? Are you using Docker, or do you really have it running on your local machine? Can you connect to it with a MySQL client? – Don't Panic Sep 23 '22 at 07:40
  • Have you tried connecting without a db_password? I had a similar issue, but this was on my windows (using wsl). I managed to get it working at the end of the day – Vrrayz Oct 09 '22 at 05:49

0 Answers0