[Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' alre ady exists (SQL: create table `users` (`id` int unsigned not null auto_incr ement primary key, `username` varchar(255) not null, `email` varchar(255) n ot null, `password` varchar(255) not null, `created_at` timestamp default 0 not null, `updated_at` timestamp default 0 not null) default character set utf8 collate utf8_unicode_ci)
錯誤原因不在這里。
很明顯可以看到這是對數據庫操作時產生的錯誤,但是我出錯在他的上一步,
[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add un ique `users_email_unique`(`email`)) [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 byte
上一步創建表時少創建了一個表,由於同時創建3個表格,所以少了一個當時也沒有看出來,但是再進行下面對數據庫的操作時產生了問題,所以我的辦法是把數據表全部重新做一遍,清除錯誤。