zoukankan      html  css  js  c++  java
  • [IlluminateDatabaseQueryException] 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 prima

    [IlluminateDatabaseQueryException]
    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)
    

      错误原因不在这里。

    很明显可以看到这是对数据库操作时产生的错误,但是我出错在他的上一步,

     [IlluminateDatabaseQueryException]
      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个表格,所以少了一个当时也没有看出来,但是再进行下面对数据库的操作时产生了问题,所以我的办法是把数据表全部重新做一遍,清除错误。

  • 相关阅读:
    干掉你的老板(小游戏)
    SEO优化数据系列表(图)
    javascript动态加载三
    javascript动态加载二
    截屏
    vimdiff
    pscp scp ftp samba windows send files to linux
    login windows 10 with passwd instead of pin
    modify requirements.txt
    整片注释 ,shell
  • 原文地址:https://www.cnblogs.com/luxia/p/7929651.html
Copyright © 2011-2022 走看看