could not find driver (SQL: select * from information_schema.tables where table_schema = oliver and

centos

laravel

在数据库迁移的时候,

php artisan migrate

 Illuminate\Database\QueryException 

  could not find driver (SQL: select * from information_schema.tables where table_schema = oliver and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
    667|         // If an exception occurs when attempting to run a query, we'll format the error
    668|         // message to include the bindings with SQL, which will make this exception a
    669|         // lot more helpful to the developer instead of just the database's errors.
    670|         catch (Exception $e) {
  > 671|             throw new QueryException(
    672|                 $query, $this->prepareBindings($bindings), $e
    673|             );
    674|         }
    675|

      +33 vendor frames 
  34  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

显示没有驱动

安装php的mysql相关库即可

yum install php-mysqlnd

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误提示说明在数据库迁移过程中,Laravel无法找到正确的数据库主机信息。你可以按照以下步骤检查和解决该问题: 1. 确保你的 `.env` 文件中的数据库相关配置项是正确的。请确保以下项已正确配置: ``` DB_HOST=your_database_host DB_PORT=your_database_port DB_DATABASE=your_database_name DB_USERNAME=your_username DB_PASSWORD=your_password ``` - `your_database_host`:数据库主机地址。 - `your_database_port`:数据库端口号。 - `your_database_name`:要连接的数据库名称。 - `your_username`:连接数据库所需的用户名。 - `your_password`:连接数据库所需的密码。 2. 确保你的数据库服务器已经启动,并且可以从你的应用程序所在的服务器上访问。可以尝试用其他工具(如phpMyAdmin)来连接和验证数据库连接参数是否正确。 3. 如果你使用的是共享主机,确保你使用的数据库主机地址和端口号是正确的。你可能需要联系你的托管提供商以获取正确的数据库连接信息。 4. 确保你的数据库用户具有足够的权限来创建和操作表。可以尝试使用命令行或其他数据库管理工具来验证该用户是否具有所需权限。 5. 如果你正在使用Laravel Valet或Homestead等开发环境,请确保这些环境已正确配置,并且与你的项目相匹配。有时,你可能需要重新启动这些环境以使配置生效。 如果你仍然无法解决该问题,请提供更多关于你的环境和配置的详细信息,以便我可以提供更具体的帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值