php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #49086 MySQLI Options page does not list defaults
Submitted: 2009-07-28 08:18 UTC Modified: 2009-11-16 12:39 UTC
From: jarrod dot makin at heartinternet dot co dot uk Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jarrod dot makin at heartinternet dot co dot uk
New email:
PHP Version: OS:

 

 [2009-07-28 08:18 UTC] jarrod dot makin at heartinternet dot co dot uk
Description:
------------
The MySQLI options manual page lists various parameters:
MYSQLI_OPT_CONNECT_TIMEOUT  	connection timeout in seconds
MYSQLI_OPT_LOCAL_INFILE  	enable/disable use of LOAD LOCAL INFILE
but doesn't state what the defaults are if you don't explicitly set them.

MYSQLI_READ_DEFAULT_FILE  	 Read options from named option file instead of my.cnf

"Read options from named option file instead of my.cnf" is misleading to me. Does this mean that MySQLI will automatically try to read in a file called my.cnf that's in the same directory as the php script?

Are there any special parameters that can be placed in the my.cnf to be used with MySQLI? There are very few examples of this functionality being used.

Reproduce code:
---------------
---
From manual page: mysqli.options
---



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-29 02:29 UTC] niel dot archer at blueyonder dot co dot uk
"Read options from named option file instead of my.cnf" is misleading. As far as I can tell, the extension does not load my.cnf (or my.ini on Windows) from any of the locations mentioned in the MySQL documentation.

The options file is documented in the MySQL documentation http://dev.mysql.com/doc/refman/5.0/en/option-files.html

The defaults appear to be:
MYSQLI_OPT_LOCAL_INFILE false
MYSQLI_READ_DEFAULT_FILE  ''.
MYSQLI_READ_DEFAULT_GROUP  'client'.
 [2009-08-01 09:03 UTC] carsten_sttgt at gmx dot de
| Does this mean that MySQLI will automatically try to read in a file
| called my.cnf that's in the same directory as the php script?

libmysql is reading the normal option files, like other mysql clients e.g. the mysql command line tool. The search paths for option files are defined during configure/compile of the mysql client lib (libmysql).

With MYSQLI_READ_DEFAULT_FILE you can specify another option file then the default ones.


| Are there any special parameters that can be placed in the my.cnf
| to be used with MySQLI? 

See the answer from Niel. libmysql is reading the groups [client] and [mysql].


BTW:
This is only working, if the PHP extensions mysql, mysqli or pdo_mysql are build with libmysql. It's not working if they are build with mysqlnd (silent ignored).


Regards,
Carsten
 [2009-08-03 08:31 UTC] jarrod dot makin at heartinternet dot co dot uk
That is very interesting.
My configure line shown in phpinfo output contains the following
'--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'

Does "shared" translate to meaning libmysql, mysqlnd or neither?
 [2009-08-03 18:47 UTC] carsten_sttgt at gmx dot de
| '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'
| 
| Does "shared" translate to meaning libmysql, mysqlnd or neither?

"--shared" means, that a shared extension is build (not a static) which must be loaded in php.ini with "extension=foo.so"

A path e.g. ",/usr" after this keyword means, that libmysql is used. In this setup libmysql (libs and headers) is located at "/usr". Or the libmysql config can be retrieved from the tool "/usr/bin/mysql_config".

BTW:
How the MySQL extensions are build (mysqlnd/libmysql), you can see in phpinfo().

Regards,
Carsten
 [2009-11-16 12:39 UTC] vrana@php.net
I can't see anything to document. Please open a new bug report with clearer description if you do.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 10:01:32 2024 UTC