Skip to content
Fix Code Error

PDOException “could not find driver”

March 13, 2021 by Code Error
Posted By: Anonymous

I have just installed Debian Lenny with Apache, MySQL, and PHP and I am receiving a PDOException could not find driver.

This is the specific line of code it is referring to:

$dbh = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS)

DB_HOST, DB_NAME, DB_USER, and DB_PASS are constants that I have defined. It works fine on the production server (and on my previous Ubuntu Server setup).

Is this something to do with my PHP installation?

Searching the internet has not helped, all I get is experts-exchange and examples, but no solutions.

Solution

You need to have a module called pdo_mysql. Looking for following in phpinfo(),

pdo_mysql

PDO Driver for MySQL, client library version => 5.1.44
Answered By: Anonymous

Related Articles

  • Ubuntu apt-get unable to fetch packages
  • How to remove MySQL completely with config and…
  • Plugin…
  • Are PDO prepared statements sufficient to prevent…
  • PHP PDO with foreach and fetch
  • Name [jdbc/mydb] is not bound in this Context
  • Exception in thread "JobGenerator"…
  • PHP A Good way to pass the PDO Object into other…
  • Failed to execute goal…
  • error LNK2005: ✘✘✘ already defined in…
  • How to set level logging to DEBUG in Tomcat?
  • Reference — What does this symbol mean in PHP?
  • Neither BindingResult nor plain target object for…
  • "Non-resolvable parent POM: Could not transfer…
  • Why am I getting a "401 Unauthorized" error in Maven?
  • Docker not able to install git on Ubuntu container
  • Showing all errors and warnings
  • PySpark 3 - UDF to remove items from list column
  • java.lang.ClassNotFoundException: HttpServletRequest
  • Problems using Maven and SSL behind proxy
  • How can I prevent SQL injection in PHP?
  • Tomcat 7 "SEVERE: A child container failed during start"
  • java.lang.RuntimeException: Unable to instantiate…
  • From inside of a Docker container, how do I connect…
  • simple php script, unable return json
  • Install pip in docker
  • apache server reached MaxClients setting, consider…
  • How do I count unique visitors to my site?
  • PDO support for multiple queries (PDO_MYSQL, PDO_MYSQLND)
  • Is this very likely to create a memory leak in Tomcat?
  • No Spring WebApplicationInitializer types detected…
  • Content is not allowed in Prolog SAXParserException
  • ERROR 1698 (28000): Access denied for user…
  • How can I find the product GUID of an installed MSI setup?
  • Exception in thread "main"…
  • PHP PDO returning single row
  • Running a simple JSF webapp on TOMEE-9.0 PLUS cannot…
  • How to use a variable for the database name in T-SQL?
  • What are the undocumented features and limitations…
  • A fatal error has been detected by the Java Runtime…
  • When I'm testing a web app by JUnit and Mockito I…
  • HTTP Status 500 - org.apache.jasper.JasperException:…
  • How to fix: "No suitable driver found for…
  • Laravel: Error [PDOException]: Could not Find Driver…
  • What's causing my java.net.SocketException:…
  • Add jars to a Spark Job - spark-submit
  • Should MySQL have its timezone set to UTC?
  • ActiveMQ Artemis in Docker shows empty screen
  • Error message "Forbidden You don't have permission…
  • PHP parse/syntax errors; and how to solve them
  • Could not calculate build plan: Plugin…
  • Left Join instead of Not Exists in SQL Db2
  • Laravel 5 PDOException Could Not Find Driver
  • How to install Maven 3 on Ubuntu…
  • slim php get route with parameter (user login system)
  • Vaadin Spring Boot - There was an exception while…
  • Spring schemaLocation fails when there is no…
  • How to install JSTL? The absolute uri:…
  • UTF-8 all the way through
  • php mysqli_connect: authentication method unknown to…
  • What does do?
  • Laravel: PDOException: could not find driver
  • Non-resolvable parent POM for Could not find…
  • How to use PDO to fetch results array in PHP?
  • Maven does not find JUnit tests to run
  • Installing PDO driver on MySQL Linux server
  • How do SO_REUSEADDR and SO_REUSEPORT differ?
  • PDO with INSERT INTO through prepared statements
  • Retrieve datas with MySQL & Backbone JS
  • Launching Spring application Address already in use
  • RabbitMQ / AMQP: single queue, multiple consumers…
  • How to change the color of vaadin-select-text-field…
  • Why Inserting a value in a nullable field from a…
  • PHP PDO: charset, set names?
  • Using enums in a spring entity
  • Setting Django up to use MySQL
  • The mysql extension is deprecated and will be…
  • Unable to Build using MAVEN with ERROR - Failed to…
  • Exception caught by gesture The following…
  • Why did Servlet.service() for servlet jsp throw this…
  • "Execute Array" problem from Database PHP
  • JPA Hibernate Persistence exception…
  • Requested bean is currently in creation: Is there an…
  • Exchange Powershell - How to invoke Exchange 2010…
  • phpMyAdmin on MySQL 8.0
  • I tried several options but this error still occurs:…
  • javax.el.PropertyNotFoundException: Property 'foo'…
  • error: 'Can't connect to local MySQL server through…
  • Fatal error: Call to a member function prepare() on null
  • How do I style a dropdown with only CSS?
  • PHP 7 RC3: How to install missing MySQL PDO
  • Selenium. Unable to locate element from the html website
  • How do I install Java on Mac OSX allowing version switching?
  • SQLSTATE[HY093]: Invalid parameter number: parameter…
  • ORA-01830: date format picture ends before…
  • How can I create an executable to run a kernel in a…
  • Access denied for user 'homestead'@'localhost'…
  • What is your most productive shortcut with Vim?
  • Maven2: Missing artifact but jars are in place
  • Reference - What does this regex mean?

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

Remove all spaces from a string in SQL Server

Next Post:

How to run multiple .BAT files within a .BAT file

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error