dongti8535 2015-11-25 10:29
浏览 36
已采纳

使用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?

  • 写回答

1条回答 默认 最新

  • dongtuo3795 2015-11-25 10:35
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 论文AlphaTensor复现(有偿)
  • ¥15 (有偿)在ANSYS中 .anf文件
  • ¥45 关于#芯片#的问题:组合逻辑电路设计
  • ¥15 基与机器学习和时间序列分析预测养老服务需求趋势
  • ¥100 求连续两帧图像在水平和垂直上偏移
  • ¥15 mysql全文索引查找指定必须关键词word无效
  • ¥15 Verilog hdl密码锁设计
  • ¥35 基于python的有ssl加密传输的socket聊天室
  • ¥15 数码管亮度控制器设计
  • ¥15 kafka客户端跨网段访问,看日志提示连接的还剩内网地址,且访问不通