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 编译失败 解决 ...
随机推荐
- Javascript基础一(介绍)
Javascript的发展历史: JavaScript在设计之初只是为了做表单验证.但是现如今,JavaScript已经成为了一门功能全面的编程语言,已经是WEB中不可缺少的一部分,如今的JavaSc ...
- WiFi基础知识
自从只需少量的话费就可以将笔记本.平板电脑连接到互联网,WiFi已成为我们熟知的网络,并无处不在.Wi-Fi对于一些物联网应用十分有用,比如楼宇自动化.内部能源管理.WiFi的重要性对于我们的日常生活 ...
- [python3]未配置locale的主机出现UnicodeDecodeError: 'ascii' codec can't decode byte 0x....的解决
之前写的发邮件的程序部署到vps的时候出现了 UnicodeDecodeError: 'ascii' codec can't decode byte 0x.... 的错误. 按理说UnicodeDec ...
- 【LeetCode】String
[227] Basic Calculator II [Medium] 实现一个简单的计算器,可以+,-,*,/. 用一个数组存数, 遇到+, - 就放进数组 : 遇到 *, / 就先计算好,再放进数组 ...
- jqery基础知识实例(二)
无缝滚动 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...
- EXCEL设置三级下拉框
EXCEL设置三级下拉框 1.添加下拉框数据源 公式--->指定 公式--->名称管理器 2.设置第一级下拉框的值 3.第一级下拉框选出一个值 4.设置第二级下拉框(INDIRECT($A ...
- Linux中网卡配置/etc/sysconfig/network-script/ifcfg-eth0
网络接口配置文件 [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE=Ethernet #网卡类型 DEVIC ...
- anaconda里的python版本回退, requirements
事情起因:我用的python3.7 , 同事机器学习的部分使用tensorflow,只支持python3.6, 所以我从3.7回退到3.6 conda create -n python36 pytho ...
- C/S模式简单socket通信
TCP连接方式 sever.c #include <stdio.h>#include <stdlib.h>#include <sys/socket.h>#inclu ...
- 2、Android自动测试之Monkey工具
Android自动测试之Monkey工具 APP测试工作中经常会听到领导说,APP压力测试做了吗?刚入行时,不知道什么是 APP压力测试,找了半天没找到自己想要的.过了几年,回头想这个问题,发现牵扯了 ...