php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56300 Can't construct (DB doesn't like "AUTOCOMMIT")
Submitted: 2005-02-14 15:41 UTC Modified: 2005-02-21 11:10 UTC
From: sean at caedmon dot net Assigned: hartmut (profile)
Status: Closed Package: PDO_MYSQL (PECL)
PHP Version: 5.0.3 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sean at caedmon dot net
New email:
PHP Version: OS:

 

 [2005-02-14 15:41 UTC] sean at caedmon dot net
Description:
------------
(from CVS, ~15:00EDT, 2005.02.14)

When connecting to MySQL 3.23 (constructor), I get:
SQLSTATE[HY000] [1064] You have an error in your SQL syntax near 'AUTOCOMMIT=1' at line 1

When I exception->getMessage()

MySQL version:
3.23.49-log

S

Reproduce code:
---------------
try {
  $PDO = new PDO('mysql:dbname=php_commits;host=localhost', 'phpcommits', 'asdu34');
}
catch (PDOException $e) {
  echo 'Connection failed: ' . $e->getMessage();
}


Expected result:
----------------
no failure

Actual result:
--------------
SQLSTATE[HY000] [1064] You have an error in your SQL syntax near 'AUTOCOMMIT=1' at line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-14 23:11 UTC] sean at caedmon dot net
Temporary fix (MySQL autocommits by default, anyway, according to the docs) -- couldn't find where SET AUTOCOMMIT=1 became valid syntax.

http://www.phpdoc.info/patches/fix_pdo_mysql.patch

(yes, I know that this isn't a real solution)

S
 [2005-02-15 00:40 UTC] wez@php.net
Hartmut, looks like we need to probe the mysql version before trying this.
 [2005-02-21 11:10 UTC] hholzgra@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jan 03 03:01:29 2025 UTC