0
votes

I've downloaded someones laravel-project and try to run it. There was also a '.sql'-file attached.

The '.env' -file was mentioned in the project's .gitignore-file, hence it wasn't included in the repository (which is the best practice, I recon). I copied this one into the project's root: https://github.com/laravel/laravel/blob/master/.env.example

I've configured the database-related section of this file like so:

  • DB_CONNECTION=xampp
  • DB_HOST=localhost
  • DB_PORT=3306
  • DB_DATABASE= my_own_db
  • DB_USERNAME=root
  • DB_PASSWORD=

(no password required)

I've run the command php artisan key:generate to add the encryption key to the ".env"-file, and tried the following steps to run the app:

  1. I start the apache web server and mysql database using the xampp-manager (macOS)
  2. I run the app using the command php artisan serve

The app itself loads, but it's empty since it doesn't read the data. However, phpMyAdmin shows that the database and it's data is readable at: http://localhost/phpmyadmin/sql.php?server=1&db= [my_own_db] [name of the table]

Here's a screenshot of the settings:

SQL Database settings shown in myPHPAdmin

These are the db's privileges:

enter image description here

What am I doing wrong?

1

1 Answers

1
votes

The DB_CONNECTION should still read mysql. That field is the driver of database connection. Xampp is a bundle of software for local web development, but your database looks to be a MariaDB. MariaDB is a fork of mysql and driver compatible.

DB_CONNECTION=mysql