Search code examples
laravelphpmyadminxampplocalhostlaravel-8

Problem connecting phpmyadmin with Laravel


I am learning laravel and have created a project in my D drive where I also have laravel related files. now I want to to connect my laravel project with the mysql database through the phpmy admin of xampp which is in the c drive. how can I do that? My laravel project is in D drive but xampp is in c drive.


Solution

  • First you should know your local address, is it using localhost or 127.0.0.1. Then, just put localhost/phpmyadmin in your search bar and it will open phpmyadmin. You should create the database and the user in your phpmyadmin, but in case you wanted to use default user in phpmyadmin just use this in your .env file.

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306 (Change this if you have another port for phpmyadmin)
    DB_DATABASE=yourdatabasename
    DB_USERNAME=yourphpmyadminusername (Default is : root)
    DB_PASSWORD=yourphpmyadminpassword (Default is : null/empty)
    

    Then you'r good to go.