|  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: -
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: MySQL related
PHP Version: 5.5.21 OS: any
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.
Block user comment
Status: Assign to:
Bug Type:
From: sveta at microbecal dot com
New email:
PHP Version: OS:


 [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

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 20 14:03:39 2021 UTC