dsyct08008 2019-01-03 12:31
浏览 107

找不到驱动程序(SQL:select user_id

I am getting this error

could not find driver (SQL: select user_id... ]

I've looked at other related questions and tried the suggestions but I am still getting the same error.

My PHP.ini has extension=php_pdo_mysql.dll

I've added "doctrine/dbal": "^2.5",

I've also tried clearing cache, config, dump auto load etc.

phpinfo() shows there are no PDO drivers.

Previously my phpstorm was pointing at a PHP installation that didn't have extension=php_pdo_mysql.dll enabled but I am still getting the same error even after pointing it to the correct PHP folder.

  • 写回答

1条回答 默认 最新

  • doucai6663 2019-01-03 12:54
    关注

    You need to install PDO drivers first and if it did not solve your problem then below is the issue I have faced before maybe that will help.

    sudo apt-get install php5.6-mysql/php7.2-mysql
    

    You also can search for other database systems.

    You also can search for the driver:

    sudo apt-cache search drivername
    

    Then Run the cmd php artisan migrate

    You can also try:

    sudo apt-get install php-sqlite3
    

    also check the path for php-cli

    If you can, run :

    composer update
    
    composer require doctrine/dbal
    

    It looks like you have a missing dependency

    Edit:

    You might need to comment out the following in your php.ini file.

    ;extension=pdo_mysql.so
    

    Taken from this post: Laravel 5 PDOException Could Not Find Driver . I think I had to do something exactly like this when setting up laravel on digital ocean.

    There must be Query like this one in the code implode inside SQL code. check the variable $mistakeIdArr should not be empty.

     $sql = "Select * from `mistake` where `id` in (".implode(',',$mistakeIdArr).")";
    

    I have also checked in my code the PDO is enabled or not

    if (extension_loaded('pdo')) { echo "pdo enable";die; }else{ echo "not enable";die;}
    
    评论

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值