简体   繁体   中英

create database with migration laravel 5.1

I want create database in laravel with migration.
I know that how to create table in laravel 5.1
but How to create database?

Impossible using Laravel classes and without already having a database setup, as you have to provide the database name and credentials in config.

Laravel database classes only operate at the database level, not the database server level. You have to create your database on your database server.

If you are using some cloud based database (like AWS) there are probably CLI commands that those vendors provide to create a database. You could theoretically call the CLI commands from Laravel, or even better use some build tool like Grunt or Gulp.

Or you can use native PHP to create a database.

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