0

hey i'm new to laravel Is that possible with Laravel 5.3 to connect to a existing database ? without make migrations manually ?

5
  • 1
    Yes this is possible. Next question? Commented Apr 19, 2017 at 9:08
  • @MayankPandeyz do you have a link or something to show me how to connect with the database ? Commented Apr 19, 2017 at 9:10
  • migrations are only for creating table structures in database - they are not linked to connetcting Commented Apr 19, 2017 at 9:10
  • @NoOorZ24 yes this is what i need i have created tables but i don't want to create 50 tables again is there any way to use them ? Commented Apr 19, 2017 at 9:12
  • 1
    Just put database config info in your env file and create Models Commented Apr 19, 2017 at 9:13

1 Answer 1

1

Inside your project folder there is a file .env, in this file set the following DB details:

DB_CONNECTION=mysql
DB_HOST=192.168.1.12
DB_PORT=3306
DB_DATABASE=databasename
DB_USERNAME=username
DB_PASSWORD=*****

and run php artisan config:cache, your application is connected with the given DB details.

Sign up to request clarification or add additional context in comments.

1 Comment

Sounds great !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.