Laravel Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found
Laravel: 5.5.*
在迁移中有重命名操作的时候,运行 php artisan migrate 会提示 Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found的错误信息,
可通过composer 安装 doctrine/dbal 类库,然后运行 迁移就可以了
修改 表字段的 enum值时,使用DB::statement() 方法进行修改字段的ENUM值
migration 文件中有以下代码:
Schema::table('users', function (Blueprint $table) {
if (Schema::hasColumn('users', 'social')) {
$table->enum('social',[
'weibo',
'zhihu',
'qq'
])->default('weibo')->index()->change();
}
});
运行 php artisan migrate 显示以下错误信息:
In AbstractPlatform.php line 434:
Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.
migration 改为:
Schema::table('users', function (Blueprint $table) {
if (Schema::hasColumn('users', 'social')) {
DB::statement("ALTER TABLE users MODIFY COLUMN social ENUM('weibo','zhihu','qq')");
}
});
然后运行php artisan migrate 就可以修改到 用户表中的social的 enum 值
Reference
Laravel Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found的更多相关文章
- 解决laravel Class 'Doctrine\DBAL\Driver\PDOMySql\Driver' not found 错误
这个错误的原因来自于没有安装一个依赖库: 官方文档说明如下: Modifying Columns Prerequisites Before modifying a column, be sure to ...
- composer安装doctrine/dbal
composer安装doctrine/dbal composer安装doctrine/dbal,安装不成功,使用的安装命令为官方提供命令“composer require doctrine/dbal” ...
- Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb ...
- Eclipse中使用MySql遇到:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading o
在Eclipse中使用MySQL遇到了点小问题 如果对Eclipse中配置MySql还有疑问的可以参考一下这篇博客:https://blog.csdn.net/qq_38247544/article/ ...
- 安装Chrome driver/ IE driver
2014-08-15 11:38 22100人阅读 评论(0) 收藏 举报 分类: python基础学习(97) >>>安装Chrome driver chrome driver ...
- [platform]linux platform device/driver(一)--Driver是如何找到对应的device
1.platform device是怎么"自动"关联到platform driver上的? 转向linux driver有些时间了,前段时间碰到个问题,在Linux kernel ...
- spingboot启动报驱动Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of th
原因: springboot应用了最新的驱动com.mysql.cj.jdbc.Driver,这个驱动需要用mysql-connector-java包的6.x版本才可以, 而mysql-connect ...
- Windows Driver Foundation-User-Mode Driver Framework 服务不能启动(错误31)问题解决
这个错误是由于WudfPf这个服务没有启动有关,导致开机时出现SVCHOST.EXE出现,内存不能"Written"的错误, http://answers.yahoo.com/qu ...
- NetBeans IDE驱动报错The path to the driver executable must be set by the web driver.chrome.driver.system property......
问题:defaulstUserDataPath=C:\\Users\\user1\\AppData\\Local\\Google\\Chrome\\User Data\\Defaul 编译失败 解决 ...
随机推荐
- List、Map、Set三个接口存取元素时,各有什么特点
List接口以特定索引来存取元素,可以有重复元素 Set接口不可以存放重复元素(使用equals方法区分是否重复) Map接口保存的是键值对(key-value-pair)映射,映射关系可以是一对一或 ...
- css图片文字
1.浏览器是把 html 和 css 一起下载并执行的,计算机里把两件事情同时做 异步加载.计算机中的同步异步和我们生活中的正好是相反的. 补充: 同步,是所有的操作都做完,才返回给用户结果.即写完 ...
- Git分布式版本控制系统(上)
Git分布式版本控制系统(上) 链接:https://pan.baidu.com/s/1CgaEv12cwfbs5RxcNpxdAg 提取码:fytm 复制这段内容后打开百度网盘手机App,操作更方便 ...
- 通过list中值得名称查询索引号
>>> a = ['www','iplaypython','com']>>> a.index('iplaypython')
- 64位 __int 与 long long写法
在做ACM题时,经常都会遇到一些比较大的整数.而常用的内置整数类型常常显得太小了:其中long 和 int 范围是[-2^31,2^31),即-2147483648~2147483647.而unsig ...
- Vuex白话教程第六讲:Vuex的管理员Module(实战篇)
写在前面 这一讲是 Vuex 基础篇的最后一讲,也是最为复杂的一讲.如果按照官方来的话,对于新手可能有点难以接受,所以想了下,决定干脆多花点时间,用一个简单的例子来讲解,顺便也复习一下之前的知识点. ...
- koa-artTemplate 的使用
1.父页面 <html> <head> <meta charset="UTF-8"> <title>我的音乐</title&g ...
- Java虚拟机(一)
一.Java发展历程 Java之父,James Gosling博士 时间 事件 1991年4月 James Gosling博士领导的Green Project启动,java语言前身Oak启动 1995 ...
- WebService发送 方法
public String disableSaleOut(JSONObject jsonObject) throws ServiceException, MalformedURLException, ...
- 【leetcode】538. Convert BST to Greater Tree
题目如下: Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the orig ...