【发布时间】:2020-11-04 21:22:36
【问题描述】:
我通过 composer 安装了全新的 laravel 7,创建了数据库并连接到 .env。 但是,当我运行迁移时,我看到以下错误:
➜ laravel-adp-4 git:(develop) ✗ php artisan migrate
Illuminate\Database\QueryException
SQLSTATE[HY000]: General error: 1030 Got error 168 - 'Unknown (generic) error from engine' from storage engine (SQL: create table `migrations` (`id` int unsigned not null auto_increment primary key, `migration` varchar(255) not null, `batch` int not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
我可以确认我的所有服务都已启动:
➜ laravel-adp-4 git:(develop) ✗ brew services list
Name Status User Plist
mysql started macbook /Users/macbook/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysql@5.7 started macbook /Users/macbook/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist
nginx started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php started root /Library/LaunchDaemons/homebrew.mxcl.php.plist
php@7.3 started macbook /Users/macbook/Library/LaunchAgents/homebrew.mxcl.php@7.3.plist
尝试进行故障排除时,我注意到我无法再操作 mysql。 当我尝试创建另一个数据库时,我看到以下错误:
ERROR 3680 (HY000): Failed to create schema directory 'alala' (errno: 2 - No such file or directory)
为什么我无法运行迁移? 为什么我无法创建数据库?
【问题讨论】: