我的mac被错误地关闭了,当我打开它的时候,数据库已经从phpmyadmin中消失了,我已经尝试了php artisan迁移,它抛出了以下错误
No such file or directory (SQL: select * from information_schema.tables where table_schema = phpdemo and table_name = migrations).我尝试在.env文件中从127.0.0.1替换DB_HOST中的本地主机。但不幸的是,我使用的是xampp,php版本7.2.7
请帮帮我
发布于 2018-08-29 02:37:28
首先,您需要检查mysql服务是否正在运行,我找到了这个How to check if MySQL server is working or not?
sudo service mysql status然后,检查.env文件,并检查数据库是否已创建,如果未创建,则可以创建数据库,然后运行
php artisan migrate如果仍然不起作用,您可能需要手动添加迁移表和所有数据,该表只有3列: id、migration、batch (在我的示例中为laravel 5.5),id是自动递增的,迁移具有迁移文件的名称(例如2014_10_12_000000_create_users_table),而my projects中的所有批处理列都具有1
发布于 2018-08-29 11:35:10
我认为您可以尝试手动创建名为phpdemo的空数据库,然后再次运行php artisan migrate
https://stackoverflow.com/questions/52058397
复制相似问题