douyan6548 2018-08-28 12:50
浏览 74

从phpmyadmin丢失数据库后,php artisan迁移错误

By Mistake My mac got shutdown and when i opened it the database was gone from phpmyadmin I have tried php artisan migrate it throws following error

No such file or directory (SQL: select * from information_schema.tables where table_schema = phpdemo and table_name = migrations).

I tried replacing localhost from 127.0.0.1 at DB_HOST in .env file . but no luck I am using xampp , php version 7.2.7

Please help me

  • 写回答

2条回答 默认 最新

  • duanjue6575 2018-08-28 18:37
    关注

    firstly you need to check if the mysql service is running, i find this How to check if MySQL server is working or not?

    sudo service mysql status
    

    then, check the .env file, and check if the database is created, if not, you can create it and then run

    php artisan migrate
    

    If still not working, maybe you'll need to add manually the migrations table, and all the data, that table ony have 3 columns: id, migration, batch (in my case, laravel 5.5), the id is an autoincrements, the migrations has the name of the migration file(for example 2014_10_12_000000_create_users_table) and all the batch columns in my projects has the 1

    评论

报告相同问题?

悬赏问题

  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码