Illuminate\Database\QueryException : SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'user_addresses' already exists (SQL: create table user_addresses
(id
int unsigned not null auto_increment primary key, user_user_id
int not null default '0' comment '用户名
id', name
varchar(32) not null default '' comment '收件人', tel
varchar(32) not null default '' comment '联系电话', area
varchar(32) not null default '' comment '所在地区', detail
varchar(255) not null default '' comment '详细地址', created_at
timestamp null, updated_at
timestamp null) default character set utf8 collate 'utf8_unicode_ci')
at D:\myphp_www\PHPTutorial\WWW\web\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'user_addresses' already exists")
D:\myphp_www\PHPTutorial\WWW\web\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458
2 PDOStatement::execute()
D:\myphp_www\PHPTutorial\WWW\web\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458
Please use the argument -v to see more details.
1、表user_addresses 已经存在,把数据库表都清了,重新执行一下数据迁移。
2、或者看一下是不是有两个创建user_addresses表的迁移文件