|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68923 Missed possible option at mysqli::options
Submitted: 2015-01-27 19:04 UTC Modified: 2023-01-10 16:54 UTC
Avg. Score:2.5 ± 0.5
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sveta at microbecal dot com Assigned:
Status: Open Package: MySQLi related
PHP Version: 5.5.21 OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-01-27 19:04 UTC] sveta at microbecal dot com
It is possible to set character set for PHP script before mysqli_connect, but does not say anything about it. It lists, instead, MYSQLI_READ_DEFAULT_FILE and MYSQLI_READ_DEFAULT_GROUP which have no effect if mysqlnd used.

Originally reported at

Test script:
$ php -m | grep mysql

$ php -r '$m=mysqli_init(); $m->options(MYSQLI_READ_DEFAULT_FILE, "/Users/sveta/.my.cnf"); $m->options(MYSQLI_READ_DEFAULT_GROUP, "client"); $m->connect("","root","f"); '

Warning: mysqli::connect(): (HY000/1045): \0414\043E\0441\0442\0443\043F \0437\0430\043A\0440\044B\0442 \0434\043B\044F \043F\043E\043B\044C\0437\043E\0432\0430\0442\0435\043B\044F 'root'@'localhost' (\0431\044B\043B \0438\0441\043F\043E\043B\044C\0437\043E\0432\0430\043D \043F\0430\0440\043E\043B\044C: \0414\0410) in Command line code on line 1

$ php -r '$m=mysqli_init(); $m->options(MYSQLI_SET_CHARSET_NAME, "utf8"); $m->connect("","root","f");'

Warning: mysqli::connect(): (HY000/1045): Доступ закрыт для пользователя 'root'@'localhost' (был использован пароль: ДА) in Command line code on line 1
Svetas-MacBook-Pro:mysql-git sveta$ php -r '$m=mysqli_init(); $m->connect("","root","f");'

Expected result:
I expect either full list of options which can be specified for mysqli::options or link to MySQL documentation with full list. But in latter case all options which are not supported by PHP extension should be noted at

Actual result:
See "test script" part.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2023-01-10 16:54 UTC]
-Package: MySQL related +Package: MySQLi related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 15:01:28 2024 UTC