简体   繁体   中英

use existing database in Laravel 5.3

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM