2.8.4.1.3. Configure database connection in Symfony

Attention!

The connection will not work with the localhost host. The host address must be taken from the database connection credentials.

Database connection details in Laravel are specified in the database configuration file:

  • If you are using an .env file, you need to change the following line:
    DATABASE_URL="mysql://username:password@host:3306/database"
  • If you are using the file app/config/parameters.yml, you need to edit the following lines:
    parameters:
        database_driver: pdo_mysql
        database_host: host
        database_port: 3306
        database_name: database
        database_user: username
        database_password: password

Changes can be made using the file manager or any FTP client.

Content