skip to Main Content

I’m new at PHP Laravel. When I run in my terminal php artisan serve it shows me an error.
enter image description here

Also I can’t have access at phpMyAdmin:enter image description here

As far I can understand, I can’t have access to the database, even when I run php artisan migrate it shows the same error.

2

Answers


  1. It seems in .env file you set empty password for database access.Set database credentials properly in .env file and try again.

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE= // your database name
    DB_USERNAME= //root or your database user
    DB_PASSWORD= // database password
    
    Login or Signup to reply.
  2. You should reset password in cmd by these commands

    1. Open the bash shell and connect to the server as root user:

      mysql -u root -h localhost -p

    2. Run ALERT mysql command:

      ALTER USER ‘userName’@’localhost’ IDENTIFIED BY ‘New-Password-Here’;

    3. Finally type SQL command to reload the grant tables in the mysql database:

      FLUSH PRIVILEGES;

    more here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search