How to connect to mysql database in xampp on Symfony project

How to connect to mysql database in xampp on Symfony project

Posted by Ervin Adams on April 28, 2022

How to connect to mysql database in xampp on Symfony project

How to connect to mysql database in xampp on Symfony project

Posted by Ervin Adams on April 28, 2022

Step 1. Start Xampp

Open your Xampp control panel, click on the Apache and MySql start buttons.

Step 2. create database in phpMyAdmin

Once Apache and MySql as started successfully open a browser such as chrome, copy and paste the url "http://localhost/dashboard/" then click on the phpMyAdmin tab. You should see the phpMyAdmin panel, click on the database tab in order to create a new database. 

Step 3. Configure .env file to connect with Xampp database.

Go to your .env file located at the root of your project and edit the database section as below:

Change the thexamppdatabasename to whatever you called the database.

DATABASE_URL=mysql://root:@127.0.0.1:3306/thexamppdatabasename
DATABASE_USER=root
DATABASE_PWD=
DATABASE_NAME=thexamppdatabasename
DATABASE_HOST=127.0.0.1

 

This field is required
Your question have been successfully submitted and will be reviewed before published
Please login to ask a question