By aisamat on
Hi,
I uploaded my drupal files from localhost to my internet web hosting throught FTP, then I uploaded the database too.
I saw a blank page, looked at google and activate reporting errors and see what's happening. When I updated page it says "Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY" in .../includes/database/...
What I've to do? I'm getting crazy :S
Comments
Similar problem, but had working D7 site until PHP got upgraded
I had a working D7 test site running against or with PHP 5.2.17. For some other sites (Joomla!) I needed for the web host sys-admin to upgrade PHP for all my sites (why not?) to PHP 5.3.6. For the Joomla! sites so far, no problem.
For the D7 test site I get the "MYSQL_ATTR_USE_BUFFERED_QUERY" db error! What (TF) changed? Web host sys-admin has no clue. I'm not as familiar with the setup of the web host as he is, nor as adept. What do I tell him?
(searching google for answers...)
Jennifer Gopinathadasi Woodward, 68
San Francisco
PDO
This seems to be an error when the MySQL PDO libraries are either incorrectly installed or not installed at all.
Only your host can fix this for you, but the first thing you can do is check: Create a simple file in your hosting space called phpinfo.php. The contents of the file should simply be this:
Then load that page in your web browser. Is PDO / pdo_mysql mentioned at all? If so, what have you got?
This signature is currently blank
Worked for me
sudo apt-get install php<YOUR PHP VERSION>-mysql
eg: sudo apt-get install php8.1-mysql
Thanx Tomy! worked
Thanx Tomy! worked
Saw that error after upgrade to Debian 9
After upgrading from Debian 8 to Debian 9 I had to install these PHP pacḱages, before I could switch to using PHP 7:
# install required PHP packagesapt-get install libapache2-mod-php7.0 php7.0-curl php7.0-gd php7.0-mbstring php7.0-mbstring php7.0-mysql php7.0-zip
# disable PHP 5.6 and enable PHP 7.0a2dismod php5
a2enmod php7.0
# restart apache to have it take effectsystemctl restart apache2.service
Thanks Ressa.
Thanks Ressa, your solution worked for me. Basically we just need to disable previous version of PHP and need to enable the latest version of PHP to fix this issue.
I hope this helps someone
Every so often I get stuck on this for a while when using my local dev environment.
What happens is I have open two terminal windows, one on my host and one on my guest, then I try to run things like composer or drush in the wrong terminal.